PDA

View Full Version : Fatal error: Using $this when not in object context...


stud
04-26-2006, 01:24 PM
When attempting to edit another users post, i am getting the following error:

Fatal error: Using $this when not in object context in /home/****/forum/editpost.php on line 433

What's funny is that no modifications were done to the editpost.php file.. and when I attempt to edit any members post - using the AJAX 'quick edit' system - this error occurs.

However when I attempt to edit any of my own posts, it does not occur. Very odd problem indeed that I am still struggling to trace the source of.

The only 2 mods installed on my boards at all are CMPS and vbArcade - neither of which should technically interact with the forums and editpost.php file whatsoever!

At first, I suspected some incompatibility of the AJAX system - but it occurs even with AJAX disabled.

Steps taken:

a. I shut off the AJAX 'quick edit' feature - and this problem still occured.
b. I disabled every single plugin one by one, still happened after each.
c. I can still edit my own posts fine... this problem only occurs when an Admin attempts to edit another user's post. This has been confirmed by another admin on the forums.
d. Replaced the editpost.php file - still occurs.

amykhar
04-26-2006, 02:27 PM
Have you made any template mods? Try creating a new style based from the default style and see if it still happens when you use that style.

stud
04-26-2006, 03:52 PM
I've made a few very minor template mods - only minor edits to the navbar so that certain links point directly the the corresponding links,

ie: ..."><a href="http://**domain**/forum/arcade.php...."
instead of
"... ><a href="forum/arcade.php ..."

I created a new style - based off the default - but it happened in that style also, without any of the template mods.

Xenon
04-26-2006, 03:58 PM
hmm, editpost.php line 433:

$userinfo['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canview'] AND


try to enabled debug mode of your board and rebuild the bitfields in your acp

Brad
04-26-2006, 04:11 PM
I don't know why but I've seen this on two client forums so far.

In editpost.php find:

$cansubscribe = (
$userinfo['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->registry->bf_ugp_forumpermissions['canview'] AND
$userinfo['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->registry->bf_ugp_forumpermissions['canviewthreads'] AND
($threadinfo['postuserid'] == $userinfo['userid'] OR $userinfo['forumpermissions']["$foruminfo[forumid]"] & $this->registry->bf_ugp_forumpermissions['canviewothers'])
);

Replace with:

$cansubscribe = (
$userinfo['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canview'] AND
$userinfo['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canviewthreads'] AND
($threadinfo['postuserid'] == $userinfo['userid'] OR $userinfo['forumpermissions']["$foruminfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canviewothers'])
);

stud
04-27-2006, 03:00 PM
Brad - thank you very much for your prompt and accurate response.

That did indeed fix my problem! Thanks to your 100 times over!

Any idea the source of this issue?

Brad
04-27-2006, 06:13 PM
I'm not sure where it comes from. I've just had to fix it multiple times for people I've done work for, seems to be a common thing. :)

joselaholla
05-07-2011, 03:15 AM
Thanks. that fix my too..