Module settings view shows errors even after successfully saving settings
See original GitHub issueBug Description
When I successfully submitted settings, the settings preview screen keeps showing errors that had been shown during editing settings. We should reset errors for a module when settings have been saved or changes have been canceled.
Steps to reproduce
- Go to the Google Analytics console and create a new account.
- Activate the Analytics module and connect the newly created account.
- Go to the settings page and make sure you see your selection on the settings preview screen.
- Go to the Google Analytics console again and delete the newly created account.
- Go back to the settings page and click on the “Edit” settings button.
- When the settings edit form loads, you should see errors on the form because it can’t find the deleted account (see screenshot below)
- Select another account, property, and profile and submit changes.
- Now you should see the settings preview screen, but errors from the settings edit form don’t disappear.
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Module store errors should be cleared after successfully saving settings
- Secondarily, module stores should not show duplicate error messages
Implementation Brief
Prevent duplicate error messages by filtering getErrors calls
- Filter errors with the exact same error message from the
StoreErrorNotices
component by adding:
const existingErrorMessages = [];
return errors
.filter( ( error ) => {
if (
! error?.message ||
existingErrorMessages.includes( error.message )
) {
return false;
}
existingErrorMessages.push( error.message );
return true;
} )
// Include other map methods in original file here…
- Clear all
modules/analytics
errors when selecting a new account. (See: 407e36905d4b21e80eb552e45ec32195857f9851) as well as when the settings screen is closed or the new settings are submitted.
Test Coverage
- N/A
Visual Regression Changes
- N/A
QA Brief
- Go to the Google Analytics console and create a new account.
- Activate the Analytics module and connect the newly created account.
- Go to the settings page and make sure you see your selection on the settings preview screen.
- Go to the Google Analytics console again and delete the newly created account.
- Go back to the settings page and click on the “Edit” settings button.
- When the settings edit form loads, you should see an error on the form because it can’t find the deleted account. You shoud only see
- Select another account, property, and profile and submit changes.
- Now you should see the settings preview screen, but errors from the settings edit form don’t disappear.
Changelog entry
- Don’t show duplicate errors when loading deleted Analytics accounts in the settings.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Fatal error when trying to save a View with grouped filters ...
When using a grouped filter in a View that is not 'string' based, saving the view gives an "Error" page with message "InvalidArgumentException: ......
Read more >Intellij is showing errors for dependencies even when project ...
I found the issue after a lot of trouble. The issue was that the poms of the sub projects were somehow marked as...
Read more >How to troubleshoot errors when you save Excel workbooks
Possible reasons why documents don't save; Quick resolution; Additional resources; Detailed view of the options; Option 1: Save the workbook ...
Read more >Troubleshooting common Maven issues | IntelliJ IDEA ...
Open Project Structure dialog and select Project from the options on the left. · Check the source language level for your project. the...
Read more >Errors to Display: None - Settings won't save - Drupal Answers
Found it! This is my first Drupal site I'm pushing to production. I still had the following lines of code in my settings.php...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
QA Update: ✅
Verified:
There is an issue that a red border remains the Analytics settings but chatting with Arafat, this needs to be a separate issue.
I’ve made a note to create a new ticket for this.
Selecting a new account doesn’t clear the fetch errors though, that’s part of the issue here—I think it’s because the errors are for various profiles/properties/etc.
When the account is selected not all errors are cleared and that’s why the message is still there… the only reliable solution I could find was to clear all errors.