You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I accidentally came across an error that occurs under certain circumstances when rendering the RichTextWidget. The error occurs under the following conditions: you are using a RichText field with pattern_options that contain a function and there are more than one allowed formats for the field - which is the default (text/html, text/x-web-textile) for new Plone Sites. If you try to edit such a form this leads to the following error:
Module plone.app.z3cform.widgets.richtext, line 104, in render
Module plone.app.z3cform.widgets.richtext, line 178, in tinymce_richtextwidget_render
Module plone.app.z3cform.widgets.richtext, line 146, in render_input_mode
Module json, line 231, in dumps
Module json.encoder, line 199, in encode
Module json.encoder, line 257, in iterencode
Module json.encoder, line 179, in default
TypeError: Object of type function is not JSON serializable
The problem lies in the render_input_mode method. With only one allowed format the base render method is used, which runs the call_callables method on the pattern_options which resolves the function calls. With multiple allowed formats the call_callables call is missing and the functions (in the patterns) will not be resolved.
This happens with version 4.3.2 and latest Plone version (6.0.11.1, Classic UI) - but as far as i can see this should also happens with every newer version.
The text was updated successfully, but these errors were encountered:
I accidentally came across an error that occurs under certain circumstances when rendering the RichTextWidget. The error occurs under the following conditions: you are using a RichText field with pattern_options that contain a function and there are more than one allowed formats for the field - which is the default (text/html, text/x-web-textile) for new Plone Sites. If you try to edit such a form this leads to the following error:
The problem lies in the
render_input_mode
method. With only one allowed format the base render method is used, which runs the call_callables method on the pattern_options which resolves the function calls. With multiple allowed formats thecall_callables
call is missing and the functions (in the patterns) will not be resolved.This happens with version 4.3.2 and latest Plone version (6.0.11.1, Classic UI) - but as far as i can see this should also happens with every newer version.
The text was updated successfully, but these errors were encountered: