Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-26560

Fix error message when deleting an entry referenced in another vocabulary

    XMLWordPrintable

    Details

    • Release Notes Summary:
      An appropriate error message is displayed when deleting an entry referenced in another vocabulary.
    • Backlog priority:
      400
    • Sprint:
      l2it-11.1.6, l2it-11.1.7

      Description

      Currently when a user tries to delete an entry which is referenced in another vocabulary, this error is displayed

      ERROR: An error occurred while deleting this entry.

      which is the same message as if any other problem occurred during the deletion.

      The code to display the error message is

                  if (err.status === 401) {
                    this.fire('notify', {message: this.i18n('label.error').toUpperCase() + ': ' +
                                                  this.i18n('vocabularyManagement.cannotDelete.referencedEntry')});
                  } else {
                    this.fire('notify', {message: this.i18n('label.error').toUpperCase() + ': ' +
                                                  this.i18n('vocabularyManagement.cannotDelete.error')});
                  }
      

      so the expected message could be displayed if a status coede 401 was returned but:
      1) this status code is never returned
      2) 401 is not relevant with this type of error

      Given the fact that the correct error message is part of the HTTP response

      {"entity-type":"exception","status":400,"message":"This entry is referenced in another vocabulary."}
      

      it should be possible to display the appropriate message by testing the "message" variable.

      Even if the message in the UI would change when this request will be taken into account, I don't think it will bother a lot of people and cause regressions in their functional tests.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 15 minutes
                1d 1h 15m