You're manually updating the node table with status NODE_NOT_PUBLISHED, after a new node was created, to achieve the publish_on_complete functionality.

This approach can possibly lead to errors, because other modules might rely on hook_node_update() to be invoked whenever the status of a node is changed. Taxonomy, for instance, adds published nodes to its private index table. Since you change the node status after node_save() has already run, the index will currently contain references to a non-published node, which is an inconsitant state.

If you want to prevent a node from publishing, the official way would be to set "$entity->status = 0" in video_field_presave(). Then, once the encoder has run successfully, use a combo of node_load() and node_save() to set the status to published, so that all module hooks are invoked correctly.

Comments

hypertext200’s picture

Status: Active » Closed (fixed)

Added complete rules integration.