0

I have developed a custom field type, widget etc all in its own module.

We also use Administration Views module with Views Bulk Operations.

Our content guys used the VBO action Publish from the Content Overview (Views) screen to mass publish few nodes which have this custom field. This caused data loss from all the nodes, but only the data from my custom field.

What causes this and how to prevent it?

1

The action does this:

  $node->status = NODE_PUBLISHED;
  entity_save('node', $node);

So the fail is not coming from VBO, you have a bug in your field code. Hard to tell where without looking at it.

  • Thanks, my hook_field_presave was expecting data in a certain hierarchy (which comes from the fieldsets on the node form) but VBO passes the entity as it's loaded from database without any hierarchy. This caused the $items in hook_field_presave to be emptied as it tried to unwrangle the hierarchy. A simple isset() has solved the issue. – Beebee Dec 12 '13 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.