News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

PHP Fatal error: Cannot redeclare template_quotefast

Started by Black Tiger, December 09, 2014, 07:30:15 PM

Previous topic - Next topic

Black Tiger

I was thinking of that too Kindred, until the other users came to post here.

From David July:
QuoteThe only mod installed is Menu Editor Lite (1.0.5).
We don't have that on any of both forums.

From Fun4us:
QuoteOnly mod highslide image viewer. SMF 2.0.9.
We don't have that mod on any of our forums either.

And if I understand them correctly, they both don't have any of the mods we are using on the forums or even any other mod at all, but they are are having the same php error.

Ofcourse I believe you as you say that it does not happen on a standard installation.
But since it also does not seem to be a specific combination of mods, as to the statements of David and Fun4us.... could it be some issue caused by the package manager?
Greetings, Black Tiger

Black Tiger

I'll mark it as solved since we got a workaround now (thank you fun4us!) and it's not a big issue and not a default installation thing.

If somebody finds the exact cause in the near future, they can always put a reply here.
Greetings, Black Tiger

Arantor

I will have to investigate this, I'm seeing it on my latest website, which has no mods in common with any of the mods outlined previously.

Black Tiger

If you got time that would be nice Arantor. No hurry though, I'm already happy with the workaround, the rest is just curiosity. ;)
Greetings, Black Tiger

fun4us

This is no problem with mods. i have one more, but less frequented smf 2.0.9 installation and it has the same problem.

Open a new message und press preview. Thats all to see the error.

Kindred

I am not saying that you are definitely wrong... And yet, despite running SMF for almost 10 years, and running 2.0.9 since before it was officially release, I have never seen that error on any of my 4 sites...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Black Tiger

Greetings, Black Tiger

Arantor

I can reproduce it but only on an environment without XDebug installed, which is weird in itself.

Kindred

and strangely enough... I can not reproduce it at all...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Black Tiger

Very odd... it gets more curious while investigating it. LoL. :D
Greetings, Black Tiger

David July

I applied the fun4us fix (thanks Stefan!) to my custom theme's Post.template.php yesterday.  Based on my tests then and again today, it appears to be working so far.  However as the issue was occurring intermittently, I will need to wait and see what happens after some regular use.  I will report back if I learn anything new.

Kindred

Well, of course that works....however, it should not be needed....   As I noted, without the "fix" I can't even recreate the issue on my own system.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DarkAngel612

I have noticed this off and on, just as mysteriously as it starts it stops. tonight I find a very filled log file (server side) that it is from Dec. 29 until now. I have applied the fix and below in the image is all the mods we have installed. will check other forums to see if it is the same there too (most of the mods are there too) and will apply the "fix" too.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Arantor

The fix doesn't magically make it fixed, it just hides the error - and it may have other unintended side effects, hard to know.

fun4us

QuoteThe fix doesn't magically make it fixed, it just hides the error - and it may have other unintended side effects, hard to know.

Sorry you are wrong. It fixes the error and stops loading twice the same function. It does not only hide the error. But the best solution is to find why the function is loaded twice and to stop this. The result will be the same.

Kindred

No, Arantor is correct...   It just hides the error by preventing the double load... However, That code should not be needed.. Most especially since I can still not reproduce it and have never seen the error on any of the 6 sites that I have run

Hiding the error with code like that does not solve the actaully problem of WHY some people are getting a double load while others do not
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

fun4us

@function whould be a hide   ;) but lets find the place where it is loaded twice to stop our messages without any helpful content. Feel free to remove the last massages.

Kindred

to be a bit pedantic... :D

@... would SUPPRESS the error...
the code as suggested HIDES it, by making it impossible to see it and debug it further. :)

anyway...   as I said, it is very difficult to debug this, since I can't even recreate it.... :(
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor


hushpiper

Poking my head in to note that I'm also seeing this error on my forum, after moving it to a new server, upgrading it to 2.0.9 and installing a few mods (Expandable Spoiler BBCode v1.7 and Yet Another Youtube BBCode v2.1). Redacted error_logs:

[25-Apr-2015 12:16:05 America/New_York] PHP Fatal error:  Cannot redeclare template_quotefast() (previously declared in /[redacted]/Sources/Load.php(2151) : eval()'d code:25) in /[redacted]/Sources/Load.php(2151) : eval()'d code on line 1001

And Apache logs:

[IP redacted] - - [25/Apr/2015:10:16:05 -0600] "POST /index.php?action=post2;board=1;preview;xml HTTP/1.1" 500 2133 "https://ssssforum.com/index.php?action=post2;start=4635;board=1" "Mozilla/5.0 (Windows NT 6.3; WOW64)

The issue is reproducible: it happens every time someone tries to preview a post. The preview does happen, but it is noticeably slow. I haven't done the fix fun4us suggested because I want to keep an eye on it. I'm going to investigate the possibility that this might've happened due to some mods getting installed twice by accident, but any suggestions as to what might be causing it would be appreciated.

Advertisement: