![]() |
Plugin Problem
I have a plugin working fine on one vB site (running 4.1.2) and when I try implementing the same plugin on another site (4.1.4) it crashes the system with an Internal Error. Here is the actual plug-in code:
The Product is vBulletin, the Hook Location is template_register_var and the Execution Order is 5. Code:
$templater = vB_Template::create('banner_rotator'); Like I said, on my vB 4.1.2 site it works fine but on the newer 4.1.4 site it crashes. I was wondering if there was something that vB updated that changes some of this code? |
Have you tried changing the Execution Order? Do you have any other modifications that use the same hook location? Have you tried disabling your other products (or even going one-by-one) to see if it is a problem between two mods that is causing the error?
I don't see anything obviously wrong with that code you posted. |
I tried changing the execution order to 1 and 10 and neither worked. No other mod uses that hook location, and I've tried disabling all mods as well as their plug-ins.
Is it possible something in the template that the plugin is calling at fault? (I did change the template name that's called in the plugin but that resulted in the same error.) And here is the exact error message: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@[domain].com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache mod_fcgid/2.3.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.repairmanjack.com Port 80 And I did check the error log and all I get is: [Mon Jul 18 21:14:59 2011] [error] [client {IP ADDRESS}] File does not exist: /home/fpaul46/public_html/500.shtml --------------- Added [DATE]1311082958[/DATE] at [TIME]1311082958[/TIME] --------------- After some more digging this seems to be the actual error message when trying to activate the plugin: [19-Jul-2011 00:51:15] PHP Warning: chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/fpaul46/public_html/forum/index.php on line 38 This is the code in index.php: Code:
chdir('./' . VB_RELATIVE_PATH); |
Actually, the full code there is:
PHP Code:
|
Quote:
|
That seems strange to me - why should something in a plugin affect code in index.php, and how is it even getting there? Maybe an include() or require() is loading the wrong file or something?
Does the same thing happen if you put some totally different code in the plugin? |
Quote:
I double checked with our host and this is what they said: From the php code the plugin introduces, the following is causing the error: $templatevalues['banner_rotator'] = $templater->render(); They asked me to double check the template code (I have) and it's the same as it is on the other site I run. |
And what is that template code? And are you sure that template exists in that style?
And what happens if you remove line 38 from your index.php page? Then what is the error in your error_log? |
Quote:
https://vborg.vbsupport.ru/showthread.php?t=252398 Quote:
|
Quote:
|
Quote:
Code:
<link rel="stylesheet" href="clientscript/nivo-slider.css" type="text/css" media="screen" /> |
I tested to make sure - using a non-existent template should just result in a (more or less) empty string.
If you haven't already, maybe try this code: PHP Code:
I'm not really an expert on these kinds of thing, but based on what I've seen before I'm kind of getting a feeling like it's a problem other than what you're doing, like maybe a php configuration issue or something wrong with the vb installation. Is this a new install of vb? Did you try running "Suspect File Versions" under Maintenance in the adminCP? |
Quote:
I changed the plugin code and that stopped the Internal Server Error. Not sure why Code:
$templater->render() But the images in the slider won't load. Not sure what's up with that, but that's a different problem entirely. |
Well, in retrospect I guess that didn't help much since you already knew it was the call to render causing the problem. But taking it out isn't really a fix since you should be able to reder a template there if you want.
|
Quote:
Also, should it be Code:
$template->render() Code:
$templater->render() |
$templater->render() is correct since that is what he defined.
Try this for preregistering: Code:
vB_Template::preRegister('header', array('templatevalues' => $templatevalues)); |
Also, is it *any* template you render via a plugin on that site that causes issues, or just this one? If it is any template, then I would suspect something like mod_security or suhosin to be the problem. Have you run diagnostics > problematic webserver modules?
|
Quote:
Quote:
Problematic Webserver pops up with No to "Module Loaded" and "AJAX Unicode Issue". --------------- Added [DATE]1311209342[/DATE] at [TIME]1311209342[/TIME] --------------- Just a minor update. When I add your code: Code:
vB_Template::preRegister('header', array('templatevalues' => $templatevalues)); Fatal error: Call to a member function render() on a non-object in /home/fpaul46/public_html/forum/includes/class_core.php(4257) : eval()'d code on line 2 |
No other ideas?
|
Ah, yeah, I can't believe I didn't think of this before, but did you try a different hook location, like maybe parse_templates? The one you're using is actually in the vB_Template code and is called when a variable is registered, so that could be causing strange things to happen.
|
Quote:
|
All times are GMT. The time now is 02:23 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|