modules/field_ui/field_ui.admin.inc:781 produces the error message There was a problem creating field %label: @message., where @message placeholder can be the HTMLed message generated by inclues/database/schema.inc:629: Table %name already exists.,

That produces a stranger end result like: There was a problem creating field Field Name: Table <em>Table Name</em> already exists.. (with em tags escaped).

Maybe !message should be used instead of @message.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Version: 7.4 » 8.x-dev
Issue tags: +Novice

Tagging.

dsm’s picture

Assigned: Unassigned » dsm
xjm’s picture

Tracking to review a patch if one is submitted.

xjm’s picture

Assigned: dsm » Unassigned

Moving back into the queue.

oriol_e9g’s picture

FileSize
226.03 KB

I can confirm the error in Drupal 8.x.

Plus: We should remove the two final sentence points and the error level message! Now is in green and should be an error in red!

oriol_e9g’s picture

Status: Needs work » Active

There are two messages with the type message problem:

drupal_set_message(t('There was a problem creating field %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())));
...
drupal_set_message(t('The field %label cannot be added because it is locked.', array('%label' => $values['label'])));

Should be:

drupal_set_message(t('There was a problem creating field %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())), 'error');
...
drupal_set_message(t('The field %label cannot be added because it is locked.', array('%label' => $values['label'])), 'error');
oriol_e9g’s picture

Title: Field ui error message can output escaped HTML » Field ui error message and incorrect type level
Status: Active » Needs work
oriol_e9g’s picture

Status: Active » Needs review
FileSize
1.24 KB
oriol_e9g’s picture

FileSize
226.03 KB
207.59 KB

Screenshots attached before/after patch.

danillonunes’s picture

Status: Needs review » Reviewed & tested by the community

Seems fine for me.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Needs a re-roll for the /core change.

oriol_e9g’s picture

Status: Needs work » Needs review
FileSize
2.5 KB

Re-rolling i have found more message level errors.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Nice.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.