Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Fast Plugin Error Detection
Revan's Avatar
Revan
Join Date: Jan 2004
Posts: 1,671

Started doing my first if...else chain in 2004, and released my first major vBulletin modification in August 2004 with the first version of the RPG Integration Hack.

Norway
Show Printable Version Email this Page Subscription
Revan Revan is offline 06-04-2006, 10:00 PM

So you have a lot of plugins, you don't know exactly what code runs in each of them, and your showthread suddenly starts spewing errors in eval()'d code.
Disabling hooks in general fixed it, so you are certain it's a hack. But which one? You now face the long task of disabling possibly 50+ products in order to see which one it is. Even by looking at hook locations, there could be any number of products.
That's where this tutorial comes in the picture. Follow these steps and you will be able to locate what product it is within minutes.
  1. Examine the error message
    Here's an example error message that Robert in IRC had yesterday:
    Code:
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/class_postbit.php(279)
    Okay, this tells you a number of things, marked in italics and underline.
    It tells you what file the hook is located, and also where in the file the hook is located.
    This enables us to move on to step 2.
  2. Determine the hook name
    This is the part where we open up /includes/class_postbit.php and go to line 279, and discover the hook name is postbit_display_complete.
    Based on this information and the one we found in Step #1, we can now move on to the next step.
  3. Query for the product
    Run the following query either in the AdminCP or in phpMyAdmin:
    Code:
    SELECT plugin.hookname, plugin.title, plugin.product, product.title
    FROM TABLEPREFIXplugin AS plugin
    LEFT JOIN TABLEPREFIXproduct AS product ON(product.productid = plugin.product)
    WHERE `hookname` = 'postbit_display_complete'
    AND phpcode LIKE '%array_merge(%'
    Replace TABLEPREFIX with your actual table prefix.
    What you are doing here is taking a small bit of the error message, the relevant bit ("array_merge") and searching for it in all the plugins that appear in the hook called in the line you saw in the error in step #1.
    This will turn up a nice set of results: The hook name, and plugin/product titles.
    You should then move on to the support thread of the hack in question, and look for a fix. If none exists, post a post with the result of the query and the hack author will fix it as soon as possible.
The italics/underlined parts are the parts that will vary from error to error. You must "replace" them with the error you are recieving in order for it to "work" for you.
Reply With Quote
  #2  
Old 06-05-2006, 01:16 PM
TTG's Avatar
TTG TTG is offline
 
Join Date: May 2004
Location: Sth London
Posts: 1,042
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very useful .. one to add to the favourites.
Thanks Revan
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 02:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06568 seconds
  • Memory Usage 2,197KB
  • Queries Executed 15 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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_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