From c68780c2958cbde96a7716d7fb12831cd62aefd4 Mon Sep 17 00:00:00 2001 From: Axel Rutz Date: Sat, 4 Jan 2014 01:07:22 +0100 Subject: [PATCH] Fixed #2103079: Rules metadata assertions for list types broken --- includes/rules.state.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/rules.state.inc b/includes/rules.state.inc index a4150e7..3e0a133 100644 --- a/includes/rules.state.inc +++ b/includes/rules.state.inc @@ -508,9 +508,14 @@ class RulesData { // before the child-wrapper is created. if (count($parts) == 1) { // Support asserting a type in case of generic entity references only. - if (isset($assertion['type']) && $var_info[$parts[0]]['type'] == 'entity') { - if (entity_get_info($assertion['type'])) { - $var_info[$parts[0]]['type'] = $assertion['type']; + $var_type = &$var_info[$parts[0]]['type']; + if (isset($assertion['type']) && ($var_type == 'entity' || $var_type == 'list')) { + // Get basic entity type to check that it is valid. + $contained_type = entity_property_list_extract_type($assertion['type']); + $basic_type = $contained_type ? $contained_type : $assertion['type']; + // Silently ignore invalid assertions. + if (entity_get_info($basic_type)) { + $var_type = $assertion['type']; } unset($assertion['type']); } -- 1.7.9.5