TinyPortal

Development => Support => Topic started by: ThunderBolt on February 06, 2006, 06:21:52 AM

Title: Undefined variable: item
Post by: ThunderBolt on February 06, 2006, 06:21:52 AM
8: Undefined variable: item
File: /xxxx/xxxx/xxxxxx_xxxx/xxxxxx/smfcsg/Themes/default/languages/TPortal.english.php (eval?)
Line: 317

(I xxx'ed out the orginal apache path)

Can you tell me how to correct this?  This is the only error now that I'm getting.. Everything else is perfect.
Title: Re: Undefined variable: item
Post by: bloc on February 06, 2006, 06:36:28 PM
That should not happen, but do you have any downloads in the dl manager yet?
Title: Re: Undefined variable: item
Post by: Minsc on February 08, 2006, 02:19:08 PM
I get a similar error.

action=tpmod;dl=admineditcat1

8: Undefined variable: item
File: /Themes/default/languages/Stats.english.php (eval?)
Line: 317


It happens whenever I click to edit a download category.  Two of those errors appear each time I click the edit button.

Yes, I have one download in the dl manager.
Title: Re: Undefined variable: item
Post by: ThunderBolt on February 08, 2006, 02:27:14 PM
Yes. this is when I get the error too.  I have 4 downloads in there under 3 categoies.

It depends on the which one I choose to edit is "cat" the number error I get "dl=admineditcat1"
Title: Re: Undefined variable: item
Post by: crip on February 08, 2006, 02:28:31 PM
Do you have UsersOnlineToday mod installed?
Title: Re: Undefined variable: item
Post by: ThunderBolt on February 08, 2006, 02:35:11 PM
Nope..  The only thing I have is TP8

I made sure that I removed ALL mods before installing TP8.  I didn't want any compatibility issues
Title: Re: Undefined variable: item
Post by: crip on February 08, 2006, 02:52:54 PM
Have you had 'that' mod installed and have since un-installed it?
Title: Re: Undefined variable: item
Post by: ThunderBolt on February 08, 2006, 02:57:07 PM
Yes.
Title: Re: Undefined variable: item
Post by: Satellite on February 12, 2006, 09:36:02 PM
I have the same error in my log and also this one:

8: Undefined index: admitems
File: TPortal.italian.php (main sub template - eval?)
Linea: 152

These popped out after applying the latest Upgrade package.
Title: Re: Undefined variable: item
Post by: Unknownn on February 12, 2006, 09:53:11 PM
Are you sure ? All errors are fixed for me now...

Trying to upgrade your files again... (http://www.tinyportal.net/smf/index.php?action=tpmod;dl=item111)
Title: Re: Undefined variable: item
Post by: Thurnok on July 29, 2006, 10:33:45 AM
I found this same issue.  I corrected the problem on my installation.  Then I saw a message about the rev2 update.  I downloaded it and looked in the files but they had the same issue.

Here's what I found.  There are array definitions in the TPdlmanager.php file for which two are never used again.  Instead, throughout the two files where all the information for those arrays are compiled, the index names are changed.  However, information is only inserted into the changed versions if you have files already in your download manager.

There are two files you need to update.  The /Sources/TPdlmanager.php file and the /Themes/default/TPdladmin.template.php file.

Here's the array defintions in question:
$context['TPortal']['dl_admcats']=array();
$context['TPortal']['dl_admitems']=array();
$context['TPortal']['dl_admcount']=array();
$context['TPortal']['dl_admsubmitted']=array();

The two arrays that give the problems are ...['dl_admitems'] and ...['dl_admcats'].  You will find that all references later on in TPdlmanager.php and TPdladmin.template.php refer to these as ...['admitems'] and ...['admcats'].  This causes the undefined index error for these items since the original arrays as depicted in the code section above are defined outright whereas all the others where the index name has changed are only created/defined if there are files in your download manager already.

I like to keep things consistent, so I simply changed all the other occurrances to ['dl_admitems'] and ['dl_admcats'] in the two files mentioned above.  There are I believe 11 and 8 occurrances respectively.

So, to sum it up, in both TPdlmanager.php and TPdladmin.template.php:
- All occurrances -
Search for ['admitems']
Replace with ['dl_admitems']
Search for ['admcats']
Replace with ['dl_admcats']

Problem resolved, files or no files in your download manager.
Title: Re: Undefined variable: item
Post by: bloc on July 29, 2006, 11:27:31 PM
Thanks, Thurnok. I think you have indeed uncovered a major error there. I have made the correction for the upcoming 0.9.5 version.
Title: Re: Undefined variable: item
Post by: Thurnok on July 30, 2006, 07:57:30 PM
np Bloc.

It is only because of TinyPortal that I have such a renewed interest in SMF.  I had tried SMF for the first time back in 2004 where I felt it to be a very capable competitor to phpBB.  I've been running numerous websites since the web was... well, the web.  I'm currently running over 30 of them, most of them using a combination of Mambo and phpBB.  I had set up some SMF sites back then; however, I had some problems with the SMF -- Mambo integration.  Unfortunately, back then I simply didn't have the time to really dig into it to see where the problems lied.  So I did not expand on my SMF use any further.

Enter TinyPortal.  I was casually browsing the Simple Machines site a few months back, as I had done occasionally over the years, where I for the first time noticed TinyPortal.  I don't know why I hadn't noticed it beforehand, other than I simply hadn't been looking for it.  After deciding to put up another test SMF site, and trying out the TinyPortal mod to see what it was made of, I was hooked!  You have an excellent product Bloc.  I'm sure you have heard that plenty of times during the history of TinyPortal, but why should that stop me from reiterating it?

All good developments fall prey to bugs here and there.  It is because of the popularity of a product that they tend to be found by those who love it most.  These are the people that want to see it succeed even further than it already has.  I'm happy to say, I've become one of those individuals.  Thanks again for a great product!
Title: Re: Undefined variable: item
Post by: bloc on July 30, 2006, 10:58:09 PM
:) Thank you. And do keep posting any errors you find, its a big help in getting the script bug-free.