PDA

View Full Version : Object of class vB_Template could not be converted to string


Wedframe
04-28-2014, 02:19 PM
Hi. Please help me with modification of plugin. This plugin work perfectly on the default style, but on installed custom style his generate php-errores:
Object of class vB_Template could not be converted to string....
strpos() expects parameter 1 to be string, object given...
Ofcause after this the page not loading....
I found hook and localized code what gives this errores. Its in parse_template
if ($vbulletin->options['legacypostbit'] AND isset($vbulletin->templatecache['postbit_legacy']) AND is_member_of($vbulletin->userinfo, unserialize($vbulletin->options['mkp_self_moderation_group'])))
{
$template =& $vbulletin->templatecache['postbit_legacy'];
}
If I comment action of statement "if"
if ($vbulletin->options['legacypostbit'] AND isset($vbulletin->templatecache['postbit_legacy']) AND is_member_of($vbulletin->userinfo, unserialize($vbulletin->options['mkp_self_moderation_group'])))
{
//$template =& $vbulletin->templatecache['postbit_legacy'];
}
then page load without errores, but plugin not work correctly.
Thanks for any help!

Lynne
04-28-2014, 04:25 PM
So, if you comment out the line regarding the postbit_legacy template, it works fine. So, compare your postbit_legacy from your custom style to the one in the default style.

vBNinja
04-28-2014, 04:47 PM
What are you trying to do? Lol

Wedframe
04-28-2014, 05:56 PM
Thanks Lynne! Yes they have a difference. I attached txt file with whole postbit_legacy template from custom style. May be if you look at them, you`ll can say something? Ofcause if its not so hard for you :erm:
vBNinja, its not my mod. I`m just use it. But with new style his stop working. Its mod for self moderation in threads, for user-topicstarters. In this hook, to forward, creats new buttons under postbits, for what users(edit/soft delete posts in his own threads).

Sorry for my english(((

kh99
04-28-2014, 08:42 PM
Where did you get the mod? You might have better luck asking the person who wrote it.

I'm thinking maybe the code in the plugin is modifying the cached template, but with the custom style, the result is a template that causes that error when eval()ed.

Wedframe
04-28-2014, 09:29 PM
Unfortunately author of this mod, dont answear in threads for rfee / four years((((

kh99
04-28-2014, 09:34 PM
Is it from this site? Can you tell us which one it is?

Wedframe
04-28-2014, 09:47 PM
No. Is it not from here...
Its here:
http://vbsupport.org/forum/showthread.php?t=40628
----------
I think I can share this mode on vbulletin.org. This is nice mod, what can be very useful in some forums... But, how can we see, its have one bug...

Lynne
04-29-2014, 02:57 AM
I'm sorry, but we don't know the mod so we don't know what the issue is. You either need to try things yourself or find someone willing to spend the time to figure it out for you.

Wedframe
04-29-2014, 12:31 PM
Ok. Its saaaad((( I was hoping for help ...
In any case, I added the archive with the module, just in case someone nevertheless wants to fix it. Just remind,.. on the default style, this mod work without any problems, and you can use it on yours forums.

Lynne
04-29-2014, 04:01 PM
I'm sorry, but you may not distribute someone else's modification without their permission, so I have had to remove it from your post. If you need help with this, you need to post in the modification thread itself.

Wedframe
04-29-2014, 05:58 PM
Ok. I understand you. Rules are rules. I`ll try to comunicate with creater of this mod and I think he would not mind if I share this mod here...
As I understand you, I must create thread in "vBulletin 4.x Add-ons" forum?

Lynne
04-29-2014, 09:08 PM
Did you download the modification from here? Then you would go post in the thread where you downloaded the modification. If you got the modification from somewhere else, then you need to go there and ask for help.