Coder Social home page Coder Social logo

autoformat plugin no longer found about template2 HOT 3 CLOSED

abw avatar abw commented on September 17, 2024
autoformat plugin no longer found

from template2.

Comments (3)

abw avatar abw commented on September 17, 2024

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

from template2.

khera avatar khera commented on September 17, 2024

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
[email protected]
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)

from template2.

atoomic avatar atoomic commented on September 17, 2024

@khera worked around the issue

from template2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.