Bug #9191
DisplayMessageBeforeRedirectMiddleware cannot reset the storage.used flag
Start date:
03 December 2015
Due date:
% Done:
100%
Estimated time:
Patch proposed:
No
Planning:
Description
Message storages do not work correctly if the used flag is reset to False. Instead of doing that we should only consume messages if necessary.
Associated revisions
History
Updated by Benjamin Dauvergne about 7 years ago
- Status changed from Nouveau to Résolu (à déployer)
- % Done changed from 0 to 100
Appliqué par commit authentic2|33d3c7195e2c4b3020a1bd5511ae0ec43227c208.
Updated by Benjamin Dauvergne almost 7 years ago
- Status changed from Résolu (à déployer) to Solution déployée
middleware: iterate message storage only if messages are consumed (fixes #9191)
If a message storage has been iterated but the used flag is reset to False,
semi-consumed messages are pushed to the cookie without normalization by
_prepare_message, as some of them are lazy strings, it breaks the JSON encoder.
The message storage must be iterated only if we are sure messages are going be
shown.