Duplicate error message hides information from the user.

Created on 9 January 2015, almost 10 years ago
Updated 7 November 2022, about 2 years ago

Please understand this is a minor issue.

I am adding a test field 'w' to an entity ( via the ui ) and get an error. The error is expected and i can resolve, but it exposes a little message issue (as below), the text of which is ambiguous to the root cause of the error.

There was a problem creating field w: The "string" plugin does not exist.

I have traced the problem to FieldStorageAddForm.php ( \Drupal\field_ui\Form\FieldStorageAddForm::submitForm() )

Looking at the comments, the code splits into 2 paths "//Create new field" and "//Re-use existing field"

this error message

drupal_set_message($this->t('There was a problem creating field %label: !message', array('%label' => $values['label'], '!message' => $e->getMessage())), 'error');

is used in both the cases and makes it difficult for me to identify which caused the error and hence get to the resolution.

So, in the event that the error is due to 'reusing' the field, rather than 'creating' it, I suggest an alteration to the message for a distinction.

[ so explicitly correct one of the message so that the difference is known as to whether the issue is caused when "creating" or "reusing" ]

drupal_set_message($this->t('There was a problem reusing field %label: !message', array('%label' => $values['label'], '!message' => $e->getMessage())), 'error');

🐛 Bug report
Status

Needs work

Version

9.5

Component
Field UI 

Last updated 9 days ago

Created by

🇬🇧United Kingdom martin107

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024