autoformat plugin no longer found #4

Open
khera opened this Issue Feb 11, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@khera

khera commented Feb 11, 2012

Upgraded from 2.23 to 2.24. I have Template::Plugin::Autoformat installed.

When processing a template which uses the autoformat filter, it fails with the complaint that it cannot find the filter.

Reverting to 2.23 (leaving all other modules as they are) solves the problem.

#!/usr/bin/perl
use strict;

use Template;

my $t = <<'EOM';
<% USE autoformat %>

<% FILTER autoformat %>
Foo.
<% END %>
EOM

my $tt = Template->new({ TAG_STYLE => 'asp' });


$tt->process(\$t,{}) or die $tt->error;

The output in 2.23 is as expected:

% perl afbug

Foo.

but in 2.24 I get this:

% perl afbug
plugin error - autoformat: plugin not found

The Template::Plugin::Autoformat is unchanged between the two runs.

@abw

This comment has been minimized.

Show comment Hide comment
@abw

abw Feb 11, 2012

Owner

On 11/02/2012 05:22, Vick Khera wrote:

When processing a template which uses the autoformat filter, it fails with the complaint that it cannot find the filter.
[...]
plugin error - autoformat: plugin not found

Hi Vick,

I'm guessing you're on a Mac. The problem is that Apple's HFS file system is case insensitive, so Template::Plugins is trying to load 'Template::Plugin::autoformat' rather than 'Template::Plugin::Autoformat' (capital 'A') and it's succeeding when it should be failing.

The reason this changed between 2.23 and 2.24 is because I removed the explicit entry for 'autoformat' from Template::Plugins, given that it's now no longer in the core.

--- Template-Toolkit-2.23/lib/Template/Plugins.pm
+++ Template-Toolkit-2.24/lib/Template/Plugins.pm
@@ -33,7 +33,6 @@
 our $PLUGIN_BASE = 'Template::Plugin';
 our $STD_PLUGINS = {
     'assert'     => 'Template::Plugin::Assert',
-    'autoformat' => 'Template::Plugin::Autoformat',

I could add the entry back, but that would only be patching over the real problem which exists with all external plugins. I've raised an RT bug to remind me about it.

https://rt.cpan.org/Ticket/Display.html?id=74865

The short-term workaround is to use the correctly capitalised name in the USE directive.

<% USE Autoformat %>

Although you still have to use the lower case variant in the FILTER name.

<% FILTER autoformat %> ... <% END %>

Cheers
Andy

Owner

abw commented Feb 11, 2012

On 11/02/2012 05:22, Vick Khera wrote:

When processing a template which uses the autoformat filter, it fails with the complaint that it cannot find the filter.
[...]
plugin error - autoformat: plugin not found

Hi Vick,

I'm guessing you're on a Mac. The problem is that Apple's HFS file system is case insensitive, so Template::Plugins is trying to load 'Template::Plugin::autoformat' rather than 'Template::Plugin::Autoformat' (capital 'A') and it's succeeding when it should be failing.

The reason this changed between 2.23 and 2.24 is because I removed the explicit entry for 'autoformat' from Template::Plugins, given that it's now no longer in the core.

--- Template-Toolkit-2.23/lib/Template/Plugins.pm
+++ Template-Toolkit-2.24/lib/Template/Plugins.pm
@@ -33,7 +33,6 @@
 our $PLUGIN_BASE = 'Template::Plugin';
 our $STD_PLUGINS = {
     'assert'     => 'Template::Plugin::Assert',
-    'autoformat' => 'Template::Plugin::Autoformat',

I could add the entry back, but that would only be patching over the real problem which exists with all external plugins. I've raised an RT bug to remind me about it.

https://rt.cpan.org/Ticket/Display.html?id=74865

The short-term workaround is to use the correctly capitalised name in the USE directive.

<% USE Autoformat %>

Although you still have to use the lower case variant in the FILTER name.

<% FILTER autoformat %> ... <% END %>

Cheers
Andy

@ghost ghost assigned abw Feb 11, 2012

@khera

This comment has been minimized.

Show comment Hide comment
@khera

khera Feb 11, 2012

Thanks Andy. I am running on FreeBSD. The docs for auto format plugin
still show it lower cased. I will update my use lines and move on to
bigger and better problems. :-)

On Feb 11, 2012, at 4:13 AM, Andy Wardley
reply@reply.github.com
wrote:

On 11/02/2012 05:22, Vick Khera wrote:

When processing a template which uses the autoformat filter, it fails with the complaint that it cannot find the filter.
[...]
plugin error - autoformat: plugin not found

Hi Vick,

I'm guessing you're on a Mac. The problem is that Apple's HFS file system is case insensitive, so Template::Plugins is trying to load 'Template::Plugin::autoformat' rather than 'Template::Plugin::Autoformat' (capital 'A') and it's succeeding when it should be failing.

The reason this changed between 2.23 and 2.24 is because I removed the explicit entry for 'autoformat' from Template::Plugins, given that it's now no longer in the core.

--- Template-Toolkit-2.23/lib/Template/Plugins.pm
+++ Template-Toolkit-2.24/lib/Template/Plugins.pm
@@ -33,7 +33,6 @@
our $PLUGIN_BASE = 'Template::Plugin';
our $STD_PLUGINS = {
'assert' => 'Template::Plugin::Assert',

  • 'autoformat' => 'Template::Plugin::Autoformat',

I could add the entry back, but that would only be patching over the real problem which exists with all external plugins. I've raised an RT bug to remind me about it.

https://rt.cpan.org/Ticket/Display.html?id=74865

The short-term workaround is to use the correctly capitalised name in the USE directive.

<% USE Autoformat %>

Although you still have to use the lower case variant in the FILTER name.

<% FILTER autoformat %> ... <% END %>

Cheers
Andy


Reply to this email directly or view it on GitHub:
#4 (comment)

khera commented Feb 11, 2012

Thanks Andy. I am running on FreeBSD. The docs for auto format plugin
still show it lower cased. I will update my use lines and move on to
bigger and better problems. :-)

On Feb 11, 2012, at 4:13 AM, Andy Wardley
reply@reply.github.com
wrote:

On 11/02/2012 05:22, Vick Khera wrote:

When processing a template which uses the autoformat filter, it fails with the complaint that it cannot find the filter.
[...]
plugin error - autoformat: plugin not found

Hi Vick,

I'm guessing you're on a Mac. The problem is that Apple's HFS file system is case insensitive, so Template::Plugins is trying to load 'Template::Plugin::autoformat' rather than 'Template::Plugin::Autoformat' (capital 'A') and it's succeeding when it should be failing.

The reason this changed between 2.23 and 2.24 is because I removed the explicit entry for 'autoformat' from Template::Plugins, given that it's now no longer in the core.

--- Template-Toolkit-2.23/lib/Template/Plugins.pm
+++ Template-Toolkit-2.24/lib/Template/Plugins.pm
@@ -33,7 +33,6 @@
our $PLUGIN_BASE = 'Template::Plugin';
our $STD_PLUGINS = {
'assert' => 'Template::Plugin::Assert',

  • 'autoformat' => 'Template::Plugin::Autoformat',

I could add the entry back, but that would only be patching over the real problem which exists with all external plugins. I've raised an RT bug to remind me about it.

https://rt.cpan.org/Ticket/Display.html?id=74865

The short-term workaround is to use the correctly capitalised name in the USE directive.

<% USE Autoformat %>

Although you still have to use the lower case variant in the FILTER name.

<% FILTER autoformat %> ... <% END %>

Cheers
Andy


Reply to this email directly or view it on GitHub:
#4 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment