moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
279 stars 199 forks source link

Fixed message queue clearance logic in ec.message.clearAll() method #631

Open dixitdeepak opened 6 months ago

dixitdeepak commented 6 months ago

The ec.message.clearAll() method is intended to clear all messages from the queue, but due to the current implementation, it fails to do so.

The method operates by first clearing the message list and then calling the clearErrors() method. The clearErrors() method is designed to clear error messages from the queue, but as part of its operation, it inadvertently adds an error message back into the messageList.

This behavior results in the clearAll method being unable to fully clear the message queue, as error messages get reintroduced after the attempt to clear them.

dixitdeepak commented 6 months ago

Alternatively we can clear the errorList and validationErrorList list in clearAll(), and set the hasErrors = false.