Since VBO offers already the possibility to resave all nodes, it would be an awesome feature to be able to resave/update entities as well.

Having this feature would make it possible to bulk update Geocoder Fields, etc.

In the meantime, I found out how to do it via the "Execute arbitrary PHP" action. Here is the code:

$entity_type = '{ENTITYTYPE}';
$wrapper = entity_metadata_wrapper($entity_type, $entity);
$wrapper->save();

Replace {ENTITYTYPE} with your entity type. Use the Devel module to find the entity type on any entity page by adding "/devel" to the end of the URL.

I hope this helps those looking for a workaround in the meantime.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NWOM created an issue. See original summary.

NWOM’s picture

Issue summary: View changes
bgilhome’s picture

Version: 7.x-3.3 » 8.x-3.x-dev
Status: Active » Needs review
FileSize
1.2 KB

I needed this feature, for the use case of updating auto entity labels on entities of a custom ECK entity type. It just needed an Action plugin, patch attached should work for any entity type.

Graber’s picture

Hmm, why not add this action to Drupal core instead?

matthieu_collet’s picture

Thank you for the patch @bgilhome
I tried it on users, but it doesn't update computed fields, is it normal ?

dqd’s picture

@Graber: from what I remember core had previously only Node Bulk Actions? Does it has Entity Bulk Actions now too? If so, then you would be right.

Apart from that: does this need a reroll for Drupal 10/11 and PHP8 ?

dqd’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Assuming a bright future for more other entities than nodes in Drupal, I set it to major FR and NW.