in viewforum.php line 1007: Notice: Undefined index: topic_type

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
User avatar
orynider
Registered User
Posts: 248
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by orynider » Thu Jun 13, 2019 6:19 pm

Code: Select all

Whoops, looks like something went wrong.
1/1 ContextErrorException in viewforum.php line 1007: Notice: Undefined index: topic_type

    in viewforum.php line 1007
    at ErrorHandler->handleError('8', 'Undefined index: topic_type', '/home/www/static/bluepink.ro/mxp.bluepink.ro/public_html/phpBB/viewforum.php', '1007') in error_handler.php line 29
http://mxp.bluepink.ro/phpBB/viewforum.php?f=2

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

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by Brf » Thu Jun 13, 2019 6:37 pm

That does not make any sense, because $row['topic_type'] is accessed four times just 30-some lines before that, unless you have a mod that is replacing $row

User avatar
canonknipser
Registered User
Posts: 1995
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by canonknipser » Thu Jun 13, 2019 7:30 pm

Brf wrote:
Thu Jun 13, 2019 6:37 pm
unless you have a mod
or a extension modifying the data using the event viewforum_modify_topicrow a few lines (at line 1000) before:
https://github.com/phpbb/phpbb/blob/077 ... 1000-L1001

So, disable all extensions and enable one by one to find the error (or scan your extension's folder for a extension using that event)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

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

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by Brf » Thu Jun 13, 2019 7:46 pm

I saw that event, but didnt think someone would write something that deletes columns from the topic rowset...

User avatar
canonknipser
Registered User
Posts: 1995
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by canonknipser » Thu Jun 13, 2019 8:06 pm

"Expect the worst, and it gets worse" ...
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
EA117
Registered User
Posts: 634
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by EA117 » Thu Jun 13, 2019 10:29 pm

I'm not familiar with the output that dumps all variables during the error, but to my eye that output seems to be dumping $row and $topic_row as though their content is identical at the time of the error? Like there has been an intentional or unintentional "$row = $topic_row".

And topic_type just happened to be the first array member tested/accessed after the assignment, but in reality any one of the expected $row members would have failed at that point.

Doesn't change anything about the recommendation; indeed, disabling extensions that could have intercepted the event seems like the most probable route for such a change to $row having happened. If that's really what the variable dump is showing.

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

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by Brf » Fri Jun 14, 2019 1:20 pm

Yes. Looking at the dump, it seems that $row has be overwritten by $topic_row

User avatar
orynider
Registered User
Posts: 248
Joined: Wed Nov 16, 2005 12:48 pm
Location: Arad, România
Name: Florin Bodin
Contact:

Re: in viewforum.php line 1007: Notice: Undefined index: topic_type

Post by orynider » Sun Jun 16, 2019 1:29 am

Brf wrote:
Fri Jun 14, 2019 1:20 pm
Yes. Looking at the dump, it seems that $row has be overwritten by $topic_row
Only now I see, is something mrgoldy wrote that I fix in my extension but I'm using the extension on more forums and never did get this error before. So I did break the functionality wile removed deprecated code.

Solved. :o

Post Reply

Return to “[3.2.x] Support Forum”