[#1743] Fetch list of flash messages from the loop itself to avoid issues with variables and block scopes.
Merge remote-tracking branch 'aliceh75/1743-flash-message-not-displayed'