TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: alex777 on April 21, 2008, 12:57:42 AM

Title: [bugtracker] Error message in log file when using "only forum-posts for frontpage
Post by: alex777 on April 21, 2008, 12:57:42 AM
Link to the topic:
http://www.tinyportal.net/index.php?topic=23458.0

I just installed the new tinyportal v.1.0.5 beta, almost everything works fine but when I go in the admin section to "Tiny Portal" and then to "Settings and Frontpage"  to "Tiny Portal - Frontpage Settings" and there activate "only forum-posts" I will get a error message in the error log file everytime after visiting the frontpage.

I get the following error message:
Undefined index: 0
Datei: /srv/www/xxx/xxx/Sources/TPortal.php
Line: 1574

Thats the code in the TPortal.php on line 1574
$context['TPortal']['current_category']=$context['TPortal']['catnames'][$row['category']];

The problem only appears when I have "only forum-post" activated for the frontpage. When I have activated "front page blocks" I do not get an error message.

The thing is that I'd like the "only forum-posts" option...but without this bug.
Title: Re: [bugtracker] Error message in log file when using \
Post by: raid on May 09, 2008, 09:04:38 PM
I am having the same error, forum post me too and the same Code on Source file


Using SMF 1.1.5 with last dilbermc (not the one for TP 0.9.8.3)
Title: Re: [bugtracker] Error message in log file when using
Post by: An_Old_Girl on May 15, 2008, 07:39:36 AM
I am getting the same error message except that I have "only articles" selected for the Front page...
Title: Re: [bugtracker] Error message in log file when using
Post by: bloc on May 15, 2008, 08:21:34 PM
How many article categories do each of you have?
Title: Re: [bugtracker] Error message in log file when using \
Post by: An_Old_Girl on May 15, 2008, 09:40:55 PM
Hi Bloc!  :)
I have only one article category, but the article I have chosen to display on the front page is not assigned to any category.

I am only getting this error on the Front Page. When I go to the forum or other areas, the error is not present.

Here is what I see:

Quotehttp://mysite.com/SMF Installation directory/index.php
Apply Filter: Only show the errors with the same message
8: Undefined index: 0
File: /home/content/m/a/1/myserverusername/html/SMF Installation directory/Sources/TPortal.php
Line: 1574

If you need to see what's around Line 1574...
if($context['TPortal']['use_wysiwyg']>0)

$context['TPortal']['allow_wysiwyg']=true;

else

$context['TPortal']['allow_wysiwyg']=false;



if(isset($context['TPortal']['usersettings']['wysiwyg'])){

// if its 0 the no-one can choose it

if($context['TPortal']['use_wysiwyg']=='0')

$context['TPortal']['usersettings']['wysiwyg']='0';



// check that we are not in admin section

if((isset($_GET['action']) && $_GET['action']=='tpadmin') && ((isset($_GET['sa']) && $_GET['sa']=='settings') || !isset($_GET['sa'])))

$in_admin=true;

if(!isset($in_admin))

$context['TPortal']['use_wysiwyg']=$context['TPortal']['usersettings']['wysiwyg'];


I was investigating some problem with the FCKeditor & wysiwyg editor when my brain overloaded and I came here hoping for salvation.  :buck2:

I am unable to select the FCK editor. After I select it and save, it reverts to the "yes, WhizzyWig" setting... just in case this has something to do with it...
Title: Re: [bugtracker] Error message in log file when using
Post by: bloc on May 16, 2008, 12:20:51 AM
They should not be related.

About the categories and article without category, that helps. :)
Title: Re: [bugtracker] Error message in log file when using \
Post by: An_Old_Girl on May 16, 2008, 05:21:35 AM
After I realized that the article on the Front Page was uncategorized, I made a new category and assigned it - no change in the error... :-\
Title: Re: [bugtracker] Error message in log file when using
Post by: bloc on May 18, 2008, 09:51:26 AM
It seems there are a error with not checking if the variable exists on that line.

try exchange line 1574

$context['TPortal']['current_category']=$context['TPortal']['catnames'][$row['category']];


with

$context['TPortal']['current_category'] = isset($context['TPortal']['catnames'][$row['category']]) ? $context['TPortal']['catnames'][$row['category']] : '-no name-';