You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to save files in the MetacatUI Editor, the save button gets stuck on "Submitting ...". The browser console shows a TypeError.
To Reproduce
Steps to reproduce the behavior:
Go to the MetacatUI Editor.
Add some files.
Click the save button.
See the error.
Expected behavior
The files should be saved without errors, and the success message should show at the top of the page
Screenshots
Here is a look at the page stuck in "Submitting .."
Here is the line of code that errors
Desktop (please complete the following information):
OS: MacOS Sequioia
Browser: Chrome
Version: 2.32.0
Additional context
Tested on: local versions of articdata.io test server as well as data-dev.ess-dive.bl.gov
JavaScript console error:
EML211EditorView.js?v=2.32.0:1231 Uncaught TypeError: errors?.forEach is not a function
at n.showValidation (EML211EditorView.js?v=2.32.0:1231:17)
at _ (backbone.js:371:57)
at m (backbone.js:356:19)
at f (backbone.js:155:16)
at u.trigger (backbone.js:346:5)
at n._validate (backbone.js:728:12)
at n.isValid (backbone.js:718:19)
at DataPackage.js?v=2.32.0:1438:19
at m.every.m.all (underscore.js:245:12)
at n.save (DataPackage.js?v=2.32.0:1437:30)
The text was updated successfully, but these errors were encountered:
The error TypeError: errors?.forEach is not a function indicates that the errors variable is not an array, and hence the forEach method is not available.
To handle the errors dictionary instead of expecting an array, you can modify the showValidation method to iterate over the dictionary entries. This change would be to use Object.entries to iterate over the errors dictionary and process each error message accordingly.
vchendrix
added a commit
to wfsi-data/metacatui
that referenced
this issue
Feb 5, 2025
- Addressed issue in `EML211EditorView.showValidation` to correctly display nested validation errors.
- Enhanced `EML211.validate` to handle annotation validation more robustly, preventing null errors.
- Added unit tests to cover the changes in `EML211EditorView.showValidation`.
FixesNCEAS#2606
Describe the bug
When trying to save files in the MetacatUI Editor, the save button gets stuck on "Submitting ...". The browser console shows a TypeError.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The files should be saved without errors, and the success message should show at the top of the page
Screenshots
Here is a look at the page stuck in "Submitting .."
Here is the line of code that errors
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: