Menuitem Spamblock (Bayes): Smarty error with recent beta1

Creating and modifying plugins.
Post Reply
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Menuitem Spamblock (Bayes): Smarty error with recent beta1

Post 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
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli »

Hi Dirk
that's the beta, or the current git master?
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

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

Post by Lux »

onli wrote:that's the beta, or the current git master?
Sorry, it is the master branch ...

Cheers

Dirk
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

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

Post 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
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

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

Post 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
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli »

Thanks for the report :)
Post Reply