- Issue created by @DamienMcKenna
- πΊπΈUnited States DamienMcKenna NH, USA
The problem comes from VBO that runs entity_save() on the *old* order object after it runs the action.
public function execute($data, array $context) { $context['entity_type'] = $this->entityType; $context['settings'] = $this->getAdminOption('settings', array()); $context += $this->formOptions; $context += $this->operationInfo['parameters']; // Actions provided by the Drupal system module require the entity to be // present in $context, keyed by entity type. if (is_object($data)) { $context[$this->entityType] = $data; } actions_do($this->operationInfo['callback'], $data, $context); // The action might need to have its entities saved after execution. if (in_array('changes_property', $this->operationInfo['behavior'])) { $data = is_array($data) ? $data : array($data); foreach ($data as $entity) { entity_save($this->entityType, $entity); } } }
- πΊπΈUnited States DamienMcKenna NH, USA
Having dug through the code I'm not sure it's possible to fix in Ubercart as VBO just uses actions_do() to run the operation, which doesn't pass the object by reference, meaning that the changed object can't be pushed back up to the original process.
Dangit.
- πΊπΈUnited States DamienMcKenna NH, USA
The issue is that VBO assumes that if the action's "behavior" value (see hook_action_info()) should be "changes_property" if it isn't defined.
- Status changed to Needs review
5 months ago 11:22am 9 September 2024 - πΊπΈUnited States DamienMcKenna NH, USA
The solution seems to be to set "behavior" to a value that doesn't do anything.