This hook assumes it is being called from a node/add form which would have $node->op. However, if the node is being inserted programmatically, then there is not a value for $node->op. Need a way to determine the context the hook is being called from.

It may be that a simple if (!isset($node->op)) return; will suffice.

Comments

robin monks’s picture

Status: Active » Fixed

Change applied to 7.x-2.x branch; thanks!

/Robin

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.