Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2006, 01:24 PM
stud stud is offline
 
Join Date: May 2004
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Fatal error: Using $this when not in object context...

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.
Reply With Quote
  #2  
Old 04-26-2006, 02:27 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-26-2006, 03:52 PM
stud stud is offline
 
Join Date: May 2004
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 04-26-2006, 03:58 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, editpost.php line 433:

PHP Code:
                        $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
Reply With Quote
  #5  
Old 04-26-2006, 04:11 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know why but I've seen this on two client forums so far.

In editpost.php find:

PHP Code:
            $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:

PHP Code:
            $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'])
            ); 
Reply With Quote
  #6  
Old 04-27-2006, 03:00 PM
stud stud is offline
 
Join Date: May 2004
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 04-27-2006, 06:13 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 05-07-2011, 03:15 AM
joselaholla joselaholla is offline
 
Join Date: Nov 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. that fix my too..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04934 seconds
  • Memory Usage 2,242KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete