set_error_handler() and "Undefined index" errors

Discussion forum for MOD Writers regarding MOD Development.
User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

set_error_handler() and "Undefined index" errors

Post by scootergrisen » Thu Jun 27, 2013 1:50 am

Support Request Template
What version of phpBB are you using? phpBB 3.0.11
What is your board's URL? http://scootergrisen.dk/forum/
Who do you host your board with? No answer given
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
What version of phpBB3 did you update from? phpBB 3.0.10
What styles do you currently have installed? prosilver
What language(s) is your board currently using? danish
Which database type/version are you using? MySQL 5
What is your level of experience? Comfortable with PHP and phpBB
When did your problem begin? When i use set_error_handler('functionname', E_ALL ^ E_WARNING); i PHP i get alot of "Undefined index" errors in my error log.
Please describe your problem.
line 165 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_IN_SEARCH ]
line 171 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: SEARCH_WORDS ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_EMAIL_PM ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_PRINT_PM ]
line 207 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_SHOW_COPPA ]
line 207 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_REGISTRATION ]
line 10 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FORUM_RULES ]
line 67 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_HAS_POLL ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 138 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_FIRST_ROW ]
line 188 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_PROFILE_FIELD1 ]
line 214 in /forum/cache/tpl_prosilver_viewtopic_body.html.php [ Undefined index: S_QUICK_REPLY ]
line 13 in /forum/cache/tpl_prosilver_jumpbox.html.php [ Undefined index: S_DISPLAY_JUMPBOX ]
line 10 in /forum/cache/tpl_prosilver_overall_footer.html.php [ Undefined index: S_WATCH_FORUM_LINK ]
line 165 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_IN_SEARCH ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_EMAIL_TOPIC ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_EMAIL_PM ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_PRINT_TOPIC ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_PRINT_PM ]
line 5 in /forum/cache/tpl_prosilver_search_results.html.php [ Undefined index: SEARCH_TOPIC ]
line 149 in /forum/cache/tpl_prosilver_search_results.html.php [ Undefined index: PREVIOUS_PAGE ]
line 149 in /forum/cache/tpl_prosilver_search_results.html.php [ Undefined index: NEXT_PAGE ]
line 1 in /forum/cache/tpl_prosilver_jumpbox.html.php [ Undefined index: S_VIEWTOPIC ]
line 4 in /forum/cache/tpl_prosilver_jumpbox.html.php [ Undefined index: S_VIEWFORUM ]
line 7 in /forum/cache/tpl_prosilver_jumpbox.html.php [ Undefined index: SEARCH_TOPIC ]
line 13 in /forum/cache/tpl_prosilver_jumpbox.html.php [ Undefined index: S_DISPLAY_JUMPBOX ]
line 10 in /forum/cache/tpl_prosilver_overall_footer.html.php [ Undefined index: S_WATCH_FORUM_LINK ]
line 10 in /forum/cache/tpl_prosilver_overall_footer.html.php [ Undefined index: U_WATCH_TOPIC ]
line 10 in /forum/cache/tpl_prosilver_overall_footer.html.php [ Undefined index: U_BOOKMARK_TOPIC ]
line 10 in /forum/cache/tpl_prosilver_overall_footer.html.php [ Undefined index: U_BUMP_TOPIC ]
line 165 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_IN_SEARCH ]
line 171 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: SEARCH_WORDS ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_EMAIL_TOPIC ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_EMAIL_PM ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_PRINT_TOPIC ]
line 184 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: U_PRINT_PM ]
line 207 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_SHOW_COPPA ]
line 207 in /forum/cache/tpl_prosilver_overall_header.html.php [ Undefined index: S_REGISTRATION ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 55 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_LAST_ROW ]
line 7 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_FIRST_ROW ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 55 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_LAST_ROW ]
line 7 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_FIRST_ROW ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 55 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_LAST_ROW ]
line 7 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_FIRST_ROW ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 55 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_LAST_ROW ]
line 7 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_FIRST_ROW ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 55 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_LAST_ROW ]
line 7 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_FIRST_ROW ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 55 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_LAST_ROW ]
line 7 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: S_FIRST_ROW ]
line 39 in /forum/cache/tpl_prosilver_forumlist_body.html.php [ Undefined index: CLICKS ]
line 10 in /forum/cache/tpl_prosilver_overall_footer.html.php [ Undefined index: S_WATCH_FORUM_LINK ]
... and so on
Generated by SRT Generator

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51834
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by Brf » Thu Jun 27, 2013 2:10 am

PhpBB already uses its own set_error_handler.

User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by scootergrisen » Thu Jun 27, 2013 8:29 pm

Where is that and where does it write error messages to ?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51834
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by Brf » Thu Jun 27, 2013 8:44 pm

It writes the error messages to the message_body webpage. That is where you get permissions errors and such, and also confirmation pages.

User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by scootergrisen » Thu Jun 27, 2013 9:05 pm

Where is set_error_handler() set ?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51834
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by Brf » Thu Jun 27, 2013 9:14 pm

common.php:

Code: Select all

// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
Don't change that though, or you will end up breaking all of the redirect and error pages.

User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by scootergrisen » Thu Jun 27, 2013 9:58 pm

Does phpBB3 save the errormessages anywhere ?

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: set_error_handler() and "Undefined index" errors

Post by Oyabun1 » Thu Jun 27, 2013 10:46 pm

Not sure what you are asking? The error messages are contained in the board's language/ files, the errors themselves may be logged, depending on the cause and nature of the error, in the board's log table in the database.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by scootergrisen » Fri Jun 28, 2013 12:02 am

Ok i cant se any "Undefined index..." errors in the phpBB3 log.

The reason why i get the errors is because i include some files with PHP that a use on the rest of my webpage so that i can have a website menu on top of the board pages.

In one of these files i use set_error_handler('functionname', E_ALL ^ E_WARNING); and also error_log() to log the errors to a logfile.

Could it be that all these Undefined index errors is something that should be fixed with phpBB3 ?

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50681
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by stevemaury » Fri Jun 28, 2013 12:27 am

No, since you are the only one who gets them.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by scootergrisen » Fri Jun 28, 2013 1:05 am

Thats because by standard the errors are ignored.

I just tested a fresh install (but still use the old database) and i still get the Undefined index errors.

If i enable in config.php these 2 linie :
@define('DEBUG', true);
@define('DEBUG_EXTRA', true);

The errormessages changes a little :
line 144 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_IN_SEARCH ]
line 170 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_EMAIL_TOPIC ]
line 170 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_EMAIL_PM ]
line 170 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_PRINT_TOPIC ]
line 170 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_PRINT_PM ]
line 192 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_SHOW_COPPA ]
line 192 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_REGISTRATION ]
line 5 in forum/includes/template.php(230) : eval()'d code [ Undefined index: SEARCH_TOPIC ]
line 37 in forum/includes/template.php(230) : eval()'d code [ Undefined index: searchresults ]
line 144 in forum/includes/template.php(230) : eval()'d code [ Undefined index: searchresults ]
line 149 in forum/includes/template.php(230) : eval()'d code [ Undefined index: PREVIOUS_PAGE ]
line 149 in forum/includes/template.php(230) : eval()'d code [ Undefined index: NEXT_PAGE ]
line 160 in forum/includes/template.php(230) : eval()'d code [ Undefined index: searchresults ]
line 1 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_VIEWTOPIC ]
line 4 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_VIEWFORUM ]
line 7 in forum/includes/template.php(668) : eval()'d code [ Undefined index: SEARCH_TOPIC ]
line 17 in forum/includes/template.php(668) : eval()'d code [ Undefined index: DEFINE ]
line 25 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_IN_MCP ]
line 25 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_IN_MCP ]
line 29 in forum/includes/template.php(668) : eval()'d code [ Undefined index: SELECTED ]
line 10 in forum/includes/template.php(668) : eval()'d code [ Undefined index: S_WATCH_FORUM_LINK ]
line 10 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_WATCH_TOPIC ]
line 10 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_BOOKMARK_TOPIC ]
line 10 in forum/includes/template.php(668) : eval()'d code [ Undefined index: U_BUMP_TOPIC ]

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: set_error_handler() and "Undefined index" errors

Post by Oyabun1 » Fri Jun 28, 2013 2:22 am

It seems you haven't defined the phpBB template variables within your added files.

Since this isn't a problem for standard phpBB, moved to MOD Writers Discussion.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51834
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by Brf » Fri Jun 28, 2013 3:00 pm

You can't be using a phpBB webpage template without the PHP files that define them. Refer to [kb]add-a-new-custom-page-to-phpbb[/kb]

User avatar
scootergrisen
Translator
Posts: 209
Joined: Thu Aug 25, 2011 2:25 pm
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by scootergrisen » Fri Jun 28, 2013 6:42 pm

I don't want to create a new page that look like the forum.

On my website i add some ekstra code to the overall_header.html file so that a menu appears on top of the forum. Is that not the right way to do that ?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51834
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: set_error_handler() and "Undefined index" errors

Post by Brf » Fri Jun 28, 2013 6:45 pm

You cannot use the overall_header.html from phpBB unless you follow the instructions in that article.

Locked

Return to “[3.0.x] MOD Writers Discussion”