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.
Comments
Comment #2
nwom commentedComment #3
bgilhome commentedI 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.
Comment #4
graber commentedHmm, why not add this action to Drupal core instead?
Comment #5
matthieu_collet commentedThank you for the patch @bgilhome
I tried it on users, but it doesn't update computed fields, is it normal ?
Comment #6
dqd@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 ?
Comment #7
dqdAssuming a bright future for more other entities than nodes in Drupal, I set it to major FR and NW.