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().
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform_uuid-only_translate_valid_uuid-2679118-0.patch | 617 bytes | raphaelhuefner |
Comments
Comment #2
raphaelhuefner commentedComment #3
crystaldawn commentedSeems logical enough. I've added this and queued a new release.