-
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
Modernize request parameter handling #641
Comments
@d-maurer wrote:
First of all, I personally do not use Zope's request parameters, but I see the issues and the need for them to be fixed.
Dropping
+1
+1
+1
good idea
I am not sure if there will be someone using these new spellings, especially as the old ones should be kept. |
It is used by |
Tests broken due to backward incompatible changes not yet fixed
Zope's current request parameter handling has several known bugs/caveats:
There is almost no error handling:
leftmost wins
leftmost wins
directive, the encoding directive is silently ignored
:record:records
);for them, some of the directives are silently ignored
Usually, the order of aggregator directives in a request parameter does
not matter. However, this is not the case for the
:tuple
directive.To really produce a tuple request variable, it must be the left most
directive; otherwise, it is equivalent to
:list
.In addition,
:tuple
is always equivalent to:list
forrequest variables aggregated as record or sequence of records.
The main use case for the
:default
directive is to provide adefault value for form controls (e.g. checkboxes) for which the browser may
or may not pass on a value when the form is submitted.
Unfortunately, this only works at the top level.
It does not work for subcomponents, e.g. an attribute of a "record".
As a consequence, if a request parameter combines
:default
withanother aggregator directive, the result may be unexpected.
The request preprocessing happens at a very early stage, before
traversal has taken place. As a consequence,
important configuration for application specific error handling
may not yet have taken effect. Exceptions raised during this stage
are reported and tracked only via "root level" error handling.
In addition, for Python 3, Zope's handling of encoding directives is currently broken (--> #634) and converter support is partially broken (#638, #558). Furthermore, Zope's encoding support is not in line with modern standards, e.g. HTML5 form support.
This issue proposes a major overhaul of Zope's request parameter handling:
zpublisher-default-encoding
configuration option and fix the encoding toutf-8
(this seems to be in line with current standards, see e.g. HTML living standard; they seem to view any non-utf-8
encoding as "legacy support" only) or fully supportHTML5' form encoding practices.
:default
and:tuple
aggregator)input
controls of typeimage
.jQuery
's "modern" parameter serialization (apparently initially invented byPHP
and now also use byRuby on rails
): i.e.var[]
is equivalent tovar:list
andvar[attr]
tovar.attr:record
.The text was updated successfully, but these errors were encountered: