Menuitem Spamblock (Bayes): Smarty error with recent beta1

Creating and modifying plugins.
Post Reply
User avatar
Lux
Regular
Posts: 761
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 » Wed Jul 27, 2016 7:40 am

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

User avatar
onli
Regular
Posts: 2230
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli » Wed Jul 27, 2016 9:32 am

Hi Dirk
that's the beta, or the current git master?

User avatar
Lux
Regular
Posts: 761
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 » Wed Jul 27, 2016 10:00 am

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

Cheers

Dirk

User avatar
onli
Regular
Posts: 2230
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli » Wed Jul 27, 2016 10:13 am

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.

User avatar
onli
Regular
Posts: 2230
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli » Wed Jul 27, 2016 10:40 am

Version 0.4.22 should fix that error, while continue to work in older s9y versions. Commit: https://github.com/s9y/additional_plugi ... 9cd6e6bbf4

User avatar
Lux
Regular
Posts: 761
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 » Wed Jul 27, 2016 11:13 am

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

User avatar
Lux
Regular
Posts: 761
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 » Thu Jul 28, 2016 7:57 am

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

User avatar
onli
Regular
Posts: 2230
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli » Thu Jul 28, 2016 10:35 am

Thanks for the report :)

Post Reply