Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 17 Aug 2010, 02:00
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Question Plugins for Forum Postbit generate errors in CMS?

I adapted the Latest Blog Using Carp add-on to vB4 here: http://www.vbulletin.org/forum/showthread.php?t=234254

At the time, I was using only the Forum (CMS and Blog disabled in the Suite) and it worked fine, displaying the title of the latest (external) blog feed in the postbit for any forum post by that member.

The add-on uses two small plug-ins:

1. Carp Configuration, attached to the "global_start" hook location (I realize this should now be changed to global_bootstrap_init_start but doing that makes no difference - I still get the errors).


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


2. Get Users Blog Entry, attached to postbit_display_start


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

When I enable CMS, however, I get errors like this depending on which hook I attach the two plgins to:

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21
The thing is that this should only function for forum posts anyway. It isn't needed in CMS (or the vBulletin Blog for that matter although I haven't enabled that yet). For me, the errors are seen whenever I try to edit the CMS article or add or edit a comment. Another user who has this installed reported the same problems.

What do I need to do to eliminate these errors?

Last edited by djbaxter; 17 Aug 2010 at 02:19.
Reply With Quote
  #2  
Old 17 Aug 2010, 05:39
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
If you only want it to work on the showthread page, then wrap the plugin at the global_start location with a THIS_SCRIPT == 'showthread' condition otherwise it is evaled on every single page.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 17 Aug 2010, 06:03
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Tried this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Error:

Fatal error: Call to undefined function CarpCacheShow() in /path/to/forum/includes/class_postbit.php(284) : eval()'d code on line 13
And if I wrap both plugins in that conditional, I get:

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21
Reply With Quote
  #4  
Old 17 Aug 2010, 17:10
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
And where is that function defined? You need to include that file with the function also.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 17 Aug 2010, 18:15
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
What function? I've shown you the entire contents of the plug-ins. The only additional code is in postbit which displays the custom field:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


The referenced line 13 in class_postbit.php in the first error is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The referenced line 21 in class_postbit.php in is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #6  
Old 19 Aug 2010, 16:22
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
I'm still unable to get this to stop throwing errors in CMS.

Any suggestions on how to proceed to locate the source of the errors?
Reply With Quote
  #7  
Old 19 Aug 2010, 16:32
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by djbaxter View Post
What function? I've shown you the entire contents of the plug-ins. The only additional code is in postbit which displays the custom field:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The referenced line 13 in class_postbit.php in the first error is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The referenced line 21 in class_postbit.php in is:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
That's actually not how you read the error.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That means, look at line 284 of class_postbit.php which is calling something which then has a problem on line 13. So, line 284 of class_postbit.php is this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The problem is with line 13 of something being called by that hook location.

But look at the error... "Call to undefined function CarpCacheShow()" A function is being called that doesn't exist on that page. That is why I asked where the function is defined. Cuz wherever that is, you need to make sure that file is included at that point.


Originally Posted by djbaxter View Post
I'm still unable to get this to stop throwing errors in CMS.

Any suggestions on how to proceed to locate the source of the errors?
You need to do something to make sure those plugins are not called on the CMS page (which is why I was suggesting using THIS_SCRIPT)
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #8  
Old 19 Aug 2010, 16:46
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
But see above: I tried using the conditional for THIS_SCRIPT and that didn't help.

But look at the error... "Call to undefined function CarpCacheShow()" A function is being called that doesn't exist on that page. That is why I asked where the function is defined. Cuz wherever that is, you need to make sure that file is included at that point.
The function is defined in the second plugin, Get Users Blog Entry, attached to postbit_display_start:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It simply pulls the information from field6.
Reply With Quote
  #9  
Old 19 Aug 2010, 16:59
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I think I'm misunderstanding something here. You say when you enable the CMS you get those errors, I had assumed you meant on the CMS page, but think I'm wrong. *What* exact page are you getting the errors on?

Are you sure $post[field6] is valid? Try entering something else and see if it works.

And this is not valid - {vb:raw post[field7]} - it's {vb:raw post.field7}
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #10  
Old 19 Aug 2010, 17:05
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Originally Posted by Lynne View Post
I think I'm misunderstanding something here. You say when you enable the CMS you get those errors, I had assumed you meant on the CMS page, but think I'm wrong. *What* exact page are you getting the errors on?
The errors occur when I try to edit a CMS article or when someone enters a comment.

Originally Posted by Lynne View Post
Are you sure $post[field6] is valid? Try entering something else and see if it works.
Yes, it's valid. Doublechecked.

Originally Posted by Lynne View Post
And this is not valid - {vb:raw post[field7]} - it's {vb:raw post.field7}
OK, I'll change that, although it doesn't seem likely that's creating the errors, does it?

--------------- Added 19 Aug 2010 at 17:10 ---------------

Examples of pages with errors:

http://forum.psychlinks.ca/content.p...ew-server/edit

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21
http://forum.psychlinks.ca/content/2...ml#new_comment

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21T

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21

Warning: Invalid argument supplied for foreach() in [path]/includes/class_postbit.php(321) : eval()'d code on line 21
--------------- Added 19 Aug 2010 at 17:33 ---------------

OK. The errors also show on the actual article page: e.g., http://forum.psychlinks.ca/content/2...ew-server.html

They do NOT show on the CMS Home page.

Other information:

Reported elsewhere and still no fix yet for this - it just occurred to me that it might be related rather than a separate issue: Articles created or promoted from forum threads show as Unpublished although all the correct checks are there to make it Published.

Last edited by djbaxter; 19 Aug 2010 at 17:36. Reason: Auto-Merged DoublePost
Reply With Quote
  #11  
Old 20 Aug 2010, 00:23
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I can't think of why you would get those errors on those pages when the hook isn't even being called on those pages in default vbulletin (at least not in 4.0.6). Have you tried turning off ALL other plugins/products except the CMS and your product and seeing if you still get the error?

Have you tried commenting out lines of the code to figure out which one it is having problems with?
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #12  
Old 20 Aug 2010, 03:25
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Thanks, Lynne. Your comments pointed me in the right direction.

I made some changes in the plug-ins but was still seeing errors. I don't fully understand why but went looking for other products and plugins that might be attaching to postbit hooks. I found an old 3.x add-on (product) that was working fine in the forums but had never been tried in CMS. When I disabled that, the errors disappeared, so obviously there was a conflict at that hook location.
Reply With Quote
  #13  
Old 20 Aug 2010, 05:28
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Glad you found it.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #14  
Old 20 Aug 2010, 06:06
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
This was the culprit in my case: http://www.vbulletin.org/forum/showthread.php?t=150761
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 Plugins, Bypass Busy and Inactive errors on non-vB pages tamarian vBulletin 3.5 Add-ons 12 06 Sep 2005 03:30



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 06:26.

Layout Options | Width: Wide Color: