I created a new type and got this message:

> Entity type Schedule slot has been updated.

That should be 'created' surely?

Also in many messages, the machine name is used in the message instead of the label.

Comments

fmizzell’s picture

Title: message on creating a new type says 'updated' » Messages when performing operations are incorrect and inconsistent
Issue summary: View changes

Yeah, I noticed a few other inconsistencies and errors also.. I will turn this issue into a general "FIX MESSAGES" to the user.

fmizzell’s picture

Version: 7.x-2.0-rc2 » 7.x-2.x-dev
joachim’s picture

    if ($entity_type->isNew) {
      drupal_set_message(t('Entity type %entity_type has been created.', array('%entity_type' => $entity_type->label)));
    }
    else {
      drupal_set_message(t('Entity type %entity_type has been updated.', array('%entity_type' => $entity_type->label)));
    }

There is actually this code there already, but $entity_type->isNew gets wiped when the entity type is saved a few lines earlier...

I'm not sure how best to fix it.

I'd be inclined to say that isNew shouldn't get wiped by save(), but then I don't know what else might rely on it. Also, I feel really wary of this:

  protected function __construct($table) {
    $this->serialize = array();
    $this->isNew = TRUE;

because that means that the flag gets set even when an entity type object is being loaded from the database, when it's surely not new!

fmizzell’s picture

Assigned: Unassigned » fmizzell

  • fmizzell committed 9dcf6a2 on 7.x-2.x
    Issue #2218189: Messages when performing operations are incorrect and...

  • fmizzell committed 717fc09 on 7.x-3.x
    Issue #2218189: Messages when performing operations are incorrect and...
fmizzell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Assigned: fmizzell » Unassigned
Status: Active » Fixed

Not sure how good the wording is, but it is all consistent now.

Status: Fixed » Closed (fixed)

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