Skip to content
Snippets Groups Projects
Commit 47bb1726 authored by lkmorlan's avatar lkmorlan Committed by Liam Morland
Browse files

Issue #3060718 by Liam Morland: Make Webform default_nid work when entity_token is enabled

parent a0809781
No related branches found
No related tags found
No related merge requests found
......@@ -830,12 +830,14 @@ function fillpdf_load_entities($fillpdf_info, $nids, $webform_array, $uc_order_i
// If no nid is given, and Entity API is disabled, use the default nid as a
// classic node. (If Entity API is enabled, we'll handle it as an entity later
// on in this function.)
if (!$entity_mode && !empty($fillpdf_info->default_nid) && empty($nids) && empty($webform_array)) {
if (empty($fillpdf_info->default_entity_type) && !empty($fillpdf_info->default_nid) && empty($nids) && empty($webform_array)) {
$default_node = node_load($fillpdf_info->default_nid);
if ($default_node) {
// Default node is a non-webform node.
if (empty($default_node->webform)) {
$context['nodes'][] = $default_node;
if (!$entity_mode) {
$context['nodes'][] = $default_node;
}
}
// Default node is a webform.
else {
......@@ -845,6 +847,8 @@ function fillpdf_load_entities($fillpdf_info, $nids, $webform_array, $uc_order_i
'node' => $default_node,
),
);
// Since this is handled here, prevent it from being processed as an entity later.
$entity_mode = FALSE;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment