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

Issue with manage_addPageTemplate #1130

Closed
GiaBen opened this issue Jun 9, 2023 · 2 comments · Fixed by #1131
Closed

Issue with manage_addPageTemplate #1130

GiaBen opened this issue Jun 9, 2023 · 2 comments · Fixed by #1131

Comments

@GiaBen
Copy link

GiaBen commented Jun 9, 2023

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

Try to add the product Page Template within the ZMI with id and no file

What I expect to happen:

To see the product appears in the ZMI

What actually happened:

I got the following error:
Traceback (innermost last):

Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 390, in publish_module
Module ZPublisher.WSGIPublisher, line 285, in publish
Module ZPublisher.mapply, line 85, in mapply
Module ZPublisher.WSGIPublisher, line 68, in call_object
Module Products.PageTemplates.ZopePageTemplate, line 379, in manage_addPageTemplate

AttributeError: 'str' object has no attribute 'filename'

What version of Python and Zope/Addons I am using:

python 3.11.3

Linux python 3.11.3 zope 5.8.2

@yurij7070
Copy link

This issue fixed by replacing line 377 in ZopePageTemplate.py
if REQUEST and 'file' in REQUEST:
replace with
if REQUEST and 'file' in REQUEST and REQUEST.get('file'):

@GiaBen
Copy link
Author

GiaBen commented Jun 14, 2023

Thanks Yurij, it makes sense (now). It works just fine.

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.

2 participants