Skip to content

Improvements on find_bad_templates() #1042

@wlang42

Description

@wlang42

Products.PageTemplate.Extensions.find_bad_templates() is a very handy tool!

However, it would be great to have two improvements:

  1. It should be able to check Filesystem Page Templates too

    ie set obj_metatypes from ('Page Template',) to
    ('Page Template', 'Filesystem Page Template')

  2. It should display HTML Tags on "Page Template scan results" page

Currently the web report looks like this:

form.pt

Compilation failed

chameleon.exc.ParseError: Unexpected end tag.

 - String:     ""
 - Filename:   /bachtest/form.pt
 - Location:   (line 13: col 25)
 - Source:     WEITERE_KONTAKTPERS
                                  ^^^^^^

But it should look like this:

form.pt

Compilation failed

chameleon.exc.ParseError: Unexpected end tag.

 - String:     "</DIV>"
 - Filename:   /bachtest/form.pt
 - Location:   (line 13: col 25)
 - Source:     WEITERE_KONTAKTPERS</DIV>
                                  ^^^^^^

ie, just quote < to &lt; in the error string

errs = [err.replace('<', '&lt;') for err in pt._v_errors]

I will make a pull request...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions