Page 1 of 1

Menuitem Spamblock (Bayes): Smarty error with recent beta1

Posted: Wed Jul 27, 2016 7:40 am
by Lux
Hi,

please check:

Fatal error: Uncaught --> Smarty: Unable to load template file '' <-- thrown in /srv/www/deimeke.net/dirk/blog/bundled-libs/Smarty/libs/sysplugins/smarty_internal_template.php on line 219

Cheers

Dirk

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Wed Jul 27, 2016 9:32 am
by onli
Hi Dirk
that's the beta, or the current git master?

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Wed Jul 27, 2016 10:00 am
by Lux
onli wrote:that's the beta, or the current git master?
Sorry, it is the master branch ...

Cheers

Dirk

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Wed Jul 27, 2016 10:13 am
by onli
I saw your other report later and realized that ;)

So, this is also related to https://github.com/s9y/Serendipity/comm ... e05b843419, but I think it also discovers a bug in renderTemplate of the plugin api. Bayes has a function called smarty_show, which relied on that weird behavior of getTemplateFile to return the path of files not found, but only when their ending is .tpl,.css or .php. In this case it is a tpl file. Now, getTemplateFile reliably returns nothing if it finds nothing, breaking that function.

The renderTemplate function the plugin should've used already properly reacts when getTemplateFile returns nothing. But it always works with the basename of the path to the template file, which makes it impossible to target templates like admin/bayesNavigation.tpl. I'll fix that in the core and push an update for bayes – *edit:* I decided to not change that in the core and only fix it in the plugin. The restriction gives no security benefit, but makes it easier for themes to override plugin templates, which is a plus.

I tested a few other plugins and they worked, but it is possible this will need to be fixed in other plugins as well.

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Wed Jul 27, 2016 10:40 am
by onli
Version 0.4.22 should fix that error, while continue to work in older s9y versions. Commit: https://github.com/s9y/additional_plugi ... 9cd6e6bbf4

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Wed Jul 27, 2016 11:13 am
by Lux
onli wrote:Version 0.4.22 should fix that error, while continue to work in older s9y versions. Commit: https://github.com/s9y/additional_plugi ... 9cd6e6bbf4
I will try once it is on Spartacus.

Cheers

Dirk

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Thu Jul 28, 2016 7:57 am
by Lux
Lux wrote:
onli wrote:Version 0.4.22 should fix that error, while continue to work in older s9y versions. Commit: https://github.com/s9y/additional_plugi ... 9cd6e6bbf4
I will try once it is on Spartacus.
Works again.

Issue closed.

Cheers

Dirk

Re: Menuitem Spamblock (Bayes): Smarty error with recent bet

Posted: Thu Jul 28, 2016 10:35 am
by onli
Thanks for the report :)