TinyPortal

Development => Support => Topic started by: tapirul on January 17, 2007, 07:08:59 PM

Title: whichbar - undefined variable
Post by: tapirul on January 17, 2007, 07:08:59 PM
Hello
I just upgraded a forum to smf 1.1.1 and TP 0.971 and I notice that I get a bunch of errors (I got 10 pages in 10 minutes), regardless of the theme used, all related to this:


Quote8: Undefined variable: whichbar
File: /...../public_html/mansarda-lui-vlad/Sources/TPortal.php
Line: 279

Line 279 is
      $show=get_blockaccess($row['access2'],false, $whichbar);

(from :

// check that we are in frontpage rather
if($mypage!='' && !isset($_GET['page']) && $context['TPortal']['is_front'] && $mypage==$context['TPortal']['featured_article'])
$show=get_blockaccess($row['access2'],true, $whichbar);
else
$show=get_blockaccess($row['access2'],false, $whichbar);

if($show)
{
// some tests to minimize sql calls


Obviously, I need help.
Heeeeeeelp!

Thanks
Title: Re: whichbar - undefined variable
Post by: G6Cad on January 17, 2007, 07:19:51 PM
A known bug from TP V.096, shouldent be there now if you have updated.
Can you try and replace the TPortal.php file with the one in the manual install package ?
Title: Re: whichbar - undefined variable
Post by: tapirul on January 17, 2007, 08:09:20 PM
I'll do that, thanks
Title: Re: whichbar - undefined variable
Post by: tapirul on January 18, 2007, 01:06:49 AM
did that, same thing.
So, to review: I updated a forum from RC3 to 1.1.1, but before that I uninstalled the mods. On the new upgraded forum I installed TP 0.971 and I started to get those errors. I replaced the TPortal.php with the one from manual_instal_files, doesn't solve the problem.

Maybe TP 0.98? :) - I see Bloc is already testing it.
Title: Re: whichbar - undefined variable
Post by: sikhness on January 18, 2007, 01:25:42 AM
Yea, i'm getting this problem as well.... I'm guessing it will probably be fixed in the next version... It really isn't causing any problems, so I think it should be ok to leave it til 0.9.8...  just my 2 cents...
Title: Re: whichbar - undefined variable
Post by: tapirul on January 18, 2007, 01:40:29 AM
Oh, I agree, it doesn't create problems. Although I guess it kind of puts a stress on the database (aren't all error messages recorded in DB - I might be wrong)
Title: Re: whichbar - undefined variable
Post by: G6Cad on January 18, 2007, 06:25:27 AM
If you turn off the error notification in the admin/configuration the errors will not be stored in the DB.
So until Bloc releases the next version turn that off :)
Title: Re: whichbar - undefined variable
Post by: tapirul on January 18, 2007, 07:43:19 AM
good point
Title: Re: whichbar - undefined variable
Post by: sikhness on January 19, 2007, 01:46:29 AM
she's got a point man...

Quote from: G6Ã,â,,¢ on January 18, 2007, 06:25:27 AM
If you turn off the error notification in the admin/configuration the errors will not be stored in the DB.
So until Bloc releases the next version turn that off :)
Title: Re: whichbar - undefined variable
Post by: Assistance on January 21, 2007, 01:43:00 AM
i currently have this error too

but wouldnt recomend turning reports off, defeats the purpose of having reports

i would recomend sorting by that error and deleting that type
and fix the others when u see fit

my opinion
Title: Re: whichbar - undefined variable
Post by: iowamf on January 24, 2007, 05:53:03 PM
I'm getting this now too - and I can duplicate it.

Create a brand new user and assign them into a primary membergroup - then login - problem shows up.

If a user registers by mail - problem doesn't show up.  However, if I assign that user into a membergroup - problem shows up.

Unfortunately, the problem is that their left blocks go away.

No mods, SMF1.1.1 TP0.7.1

What is weird - is that I had about 10 users in various membergroups (and still have those users) where there is no problem (everything works for those users).
Title: Re: whichbar - undefined variable
Post by: IchBin on January 24, 2007, 06:18:55 PM
Well, I don't see this in the bug tracker so I think I'll add it. Bloc can decide what to do from there.
Title: Re: whichbar - undefined variable
Post by: bloc on January 24, 2007, 07:28:50 PM
To solve the error, find that line where "$whichbar" is called in TPortal.php and set $whichbar=''; on a line above it.
Title: Re: whichbar - undefined variable
Post by: iowamf on January 24, 2007, 11:19:22 PM
I stuck that above the if/elseif statement as shown below and the error is not showing up in the log.
However, the symptom of the leftbar disappearing is still present.

if($allow){
// save which pan
$whichbar='';
if($row['bar']=='1')
$whichbar='hide_leftbar_forum';
elseif($row['bar']=='1')
$whichbar='hide_rightbar_forum';
elseif($row['bar']=='1')
$whichbar='hide_centerbar_forum';

// check that we are in frontpage rather
Title: Re: whichbar - undefined variable
Post by: bloc on January 25, 2007, 10:21:01 AM
Yes...if you look at the code there, thats the other bug as well lol. it should be:

if($allow){
// save which pan
$whichbar='';
if($row['bar']=='1')
$whichbar='hide_leftbar_forum';
elseif($row['bar']=='2')
$whichbar='hide_rightbar_forum';
elseif($row['bar']=='3')
$whichbar='hide_centerbar_forum';

// check that we are in frontpage rather
Title: Re: whichbar - undefined variable
Post by: iowamf on January 25, 2007, 01:46:52 PM
Thanks - that appears to have worked - the left bars are back and no whichbar in the error log.

Easy as 1,2,3  8)
Title: Re: whichbar - undefined variable
Post by: jagu on January 31, 2007, 02:24:55 AM
Yea, i just posted it on bugtracker... b4 i saw this post, anyways, thanks...
Title: Re: whichbar - undefined variable
Post by: elliel on February 14, 2007, 05:40:47 PM
I just wanted to say that I got this error today,and the reason was, that I uninstalled TP, before upgrading smf.  But before I did that, I had moved all my left side blocks to the right.  Then when I reinstalled TP, it reinstalled with my same settings ie blocks on the right, none on the left, and this error popped up over and over. 

I moved them all back to the left and it disappeared. 

I just thought I'd mention it in case someone else does the same thing as I did :)
Title: Re: whichbar - undefined variable
Post by: mprayii on February 17, 2007, 07:22:57 PM
Thank you, I was wondering what to do with this and was avoiding it, hoping it wouldnt cause any complications.... after I saw that I had almost 5000 pages of forum errors with this, I felt it was time for action.

It has been fixed.

Thanks tons!
Title: Re: whichbar - undefined variable
Post by: skiller on February 18, 2007, 07:11:10 AM
Thanks for these easy tips on solving the bugs Bloc :)

Keep up the great work!