Skip to content

Commit 4bbe9fb

Browse files
authored
Issue #22: Fix hook_entity_view_alter implementation.
Fixes #22. By @laryn @padprint @simonphu and @olafgrabienski.
1 parent ac9e2b9 commit 4bbe9fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

conditional_fields.module

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,12 +929,15 @@ function conditional_fields_entity_view_alter(&$build, $type) {
929929
$evaluated_dependents = array();
930930

931931
foreach ($dependencies['dependents'] as $dependent => $dependency) {
932+
$dependent_parts = explode('.', $dependent);
933+
$dependent = $dependent_parts[2];
932934
if (empty($build[$dependent]['#access'])) {
933935
continue;
934936
}
935937

936938
foreach ($dependency as $dependency_options) {
937-
$dependee = $dependency_options['dependee'];
939+
$dependee_parts = explode('.', $dependency_options['dependee']);
940+
$dependee = $dependee_parts[2];
938941
$options = $dependency_options['options'];
939942

940943
// We can interface with the States API only through the Value condition.

0 commit comments

Comments
 (0)