In webform_uuid_webform_submission_presave(), sometimes $entity->webform['nid'] already contains a valid NID because it has been translated from a UUID elsewhere. (For instance when loading the node via node_load(), this field is already set to the NID, not the UUID.)

In that case, the lookup via entity_get_id_by_uuid() fails and returns an empty array, which makes webform_submission_insert() try to assign an empty NID to $submission->nid. In turn, this can break other contrib modules, for instance webform_workflow.

I suggest checking with uuid_is_valid() if we even have a UUID at hand to be translated back into a NID.

But maybe other conditions could also be checked to decide whether to attempt calling entity_get_id_by_uuid().

For now, I'll include a patch using uuid_is_valid().

Comments

raphaelhuefner created an issue. See original summary.

raphaelhuefner’s picture

crystaldawn’s picture

Status: Active » Closed (fixed)

Seems logical enough. I've added this and queued a new release.