From 011af58b1fe6682f4bc3517b5c22d52cc53d5130 Mon Sep 17 00:00:00 2001
From: Dan Chadwick <dan899@gmail.com>
Date: Mon, 13 Jul 2015 07:57:41 -0400
Subject: [PATCH] Issue #2529246 by amoebanath, DanChadwick: Includes missed
 when loading submission, with entitycache installed.

---
 includes/webform.webformconditionals.inc |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/includes/webform.webformconditionals.inc b/includes/webform.webformconditionals.inc
index b1a42cb..0bf4fd0 100644
--- a/includes/webform.webformconditionals.inc
+++ b/includes/webform.webformconditionals.inc
@@ -370,6 +370,12 @@ class WebformConditionals {
 
           // Perform the comparison callback and build the results for this group.
           $comparison_callback = $operator_info[$rule['operator']]['comparison callback'];
+          // Contrib caching, such as entitycache, may have loaded the node
+          // without building it. It is possible that the component include file
+          // hasn't been included yet. See #2529246.
+          if (!function_exists($comparison_callback)) {
+            webform_component_include($source_component['type']);
+          }
           $conditional_results[] = $comparison_callback($source_values, $rule['value'], $source_component);
 
           // Record page number to later determine any intra-page dependency on this source.
-- 
1.7.8.msysgit.0

