Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements on find_bad_templates() #1042

Closed
wlang42 opened this issue May 19, 2022 · 0 comments · Fixed by #1043
Closed

Improvements on find_bad_templates() #1042

wlang42 opened this issue May 19, 2022 · 0 comments · Fixed by #1043

Comments

@wlang42
Copy link
Contributor

wlang42 commented May 19, 2022

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...

@dataflake dataflake linked a pull request May 19, 2022 that will close this issue
dataflake added a commit that referenced this issue May 20, 2022
* improvements on find_bad_templates, add FS PageTemplates, show html tags (#1042)

* Update src/Products/PageTemplates/Extensions/find_bad_templates.py

Co-authored-by: Jens Vagelpohl <jens@plyp.com>

* fix lint error (line too long)

Co-authored-by: Jens Vagelpohl <jens@plyp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant