In ECK entity from submit:

drupal_set_message(t("Entity {$entity->id} - @entity_label has been saved", array("@entity_label" => entity_label($form['#entity_type'], $entity)) ));

The message 'Entity 3 - Test member has been saved' is just really odd and unlike any other part of drupal. To be honest, I don't want the users of the website to see what entity id it is. Can you make it the same as any other entity and just have the @type !name has been saved. 'Member Profile Test member has been saved.' (Member profile being the entity here).

If that works for you, I'm happy to make a patch and send it though to you.

Comments

jamesharv’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.19 KB
new1.77 KB

I thought I'd have a crack at writing a patch for this. To me it made more sense for the default message to reference the entity bundle, rather than the entity type (Eg. "Basic Page", rather than "Node"), and to allow the message to be altered via a drupal_alter() hook.

I've attached a patch against the current 7.x-2.x branch, as well as another patch against the current stable release (7.x-2.0-rc2) for anyone who wants to use this with the stable version of the module.

nonsimilar’s picture

Agreed: the original message is not even translatable because it's dynamic... I'll try the patch.

EDIT: patch works and I definitely prefer these messages.

damienmckenna’s picture

Version: 7.x-2.0-rc2 » 7.x-2.x-dev

Was the patch checked against 7.x-2.x-dev?

damienmckenna’s picture

Doh, never mind, comment #1 says it was.

timmarwick’s picture

StatusFileSize
new1.85 KB

For some reason this patch would not apply to latest 7-2.x, so I've re-rolled it for the latest dev version.

Note: this patch version also cleanly applies to 7.x-2.0-rc4.

Finally, I think this is a good solution for the standard ECK save messages (which are quite weird), and am wondering if this will be rolled into the main branch anytime soon?

pcambra’s picture

Here's an updated version of #5, no need to send the type of the entity when we're sending already the entity itself.

Attached are a patch for the latest HEAD and also one for rc2 because of legacy.

weri’s picture

Status: Needs review » Reviewed & tested by the community

Thats exactly how it should work. Thanks for the patch!

I tested and reviewed the patch 'entity-save-message-2006710-6.patch'. Everything looks good and it's ready to commit.

The last submitted patch, 1: entity-save-message-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2.0-rc2-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2.0-rc2-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2.0-rc2-2006710-1.patch, failed testing.

The last submitted patch, 1: entity-save-message-2.0-rc2-2006710-1.patch, failed testing.

The last submitted patch, 5: entity-save-message-2006710-5.patch, failed testing.

The last submitted patch, 5: entity-save-message-2006710-5.patch, failed testing.

The last submitted patch, 5: entity-save-message-2006710-5.patch, failed testing.

The last submitted patch, 5: entity-save-message-2006710-5.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6-rc2.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6-rc2.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6-rc2.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6-rc2.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 6: entity-save-message-2006710-6.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6.patch, failed testing.

The last submitted patch, 6: entity-save-message-2006710-6.patch, failed testing.

djdevin’s picture

Status: Needs work » Reviewed & tested by the community

Still applies to 2.x and works fine.

djdevin’s picture

Status: Reviewed & tested by the community » Closed (duplicate)