-
Notifications
You must be signed in to change notification settings - Fork 101
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
Serve MessageDialogs and exception views as text/html #1081
Serve MessageDialogs and exception views as text/html #1081
Conversation
looks odd in the new ZMI, but it's better than This implementation is a bit tricky, it uses Zope/src/ZPublisher/HTTPResponse.py Lines 541 to 544 in 6aa5e4d
/cc @dataflake @GiaBen |
2de1f78
to
a383f02
Compare
the test on zope 4 seems to show a regression with this approach |
Now that Zope uses text/plain by default, MessageDialogs were served as text/plain. Keep compatibility by returning a special string with `asHTML` method, that ZPublisher.HTTPResponse.HTTPResponse.setBody understands. MessageDialogs are deprecated and do not integrate well in Zope >= 4 ZMI, but they are used in some old products.
a383f02
to
c5410e7
Compare
It's OK now. For the details: in the previous version I was changing
|
Thanks @dataflake for the amendments 👍 |
Now that Zope uses text/plain by default, MessageDialogs were served as text/plain. Keep compatibility by returning a special string with
asHTML
method, that ZPublisher.HTTPResponse.HTTPResponse.setBody understands.MessageDialogs are deprecated and do not integrate well in Zope >= 4 ZMI, but they are used in some old products.
Fixes issues discussed in #1079 (comment)