cubicweb #5298657 Form should not use set_redirect_message [open]

Form has a 'submitmsg' attribute, that allows a form to display a specific message on submit.

The current implementation makes use of the Request.setredirect_message method. It is wrong for the following reason:

  • If several forms are instanciated (whatever the reason) during the same request handling, only the last one instanciated will have its message associated to a msgid which is unique to the request.
  • If the form is never submitted, an id and its message will remain in the session datas for nothing.

I think the message should be set as the redirect message only by the editcontroller when it handles the submit.

This way, the message gets stored in the session only when needed, and has no risk to be overridden.

Reimplementing the submitmsg this way has another big advantage: it puts back the _cwmsgid as an implementation detail of set/append_redirect_message. Doing that, we can reimplement it easily, as we need to in pyramid_cubicweb.

done in<not specified>
closed by<not specified>