Skip to content
Snippets Groups Projects
Commit 6538b18a authored by Eirik Morland's avatar Eirik Morland Committed by Eirik Morland
Browse files

Issue #3005028 by eiriksm: in_array('inline_entity_form',...

Issue #3005028 by eiriksm: in_array('inline_entity_form', $element['#array_parents']) can return false positive
parent b78f5f77
Branches
No related tags found
No related merge requests found
...@@ -107,7 +107,14 @@ class ImageCanvasEditorWidget extends ImageWidget { ...@@ -107,7 +107,14 @@ class ImageCanvasEditorWidget extends ImageWidget {
// Find the form mode. // Find the form mode.
// @todo: This seems a bit hacky. // @todo: This seems a bit hacky.
$form_mode = 'default'; $form_mode = 'default';
if (in_array('inline_entity_form', $element['#array_parents'])) { $is_inline = FALSE;
foreach ($element['#array_parents'] as $parent_name) {
if ($parent_name === 'inline_entity_form') {
$is_inline = TRUE;
break;
}
}
if ($is_inline) {
$inline_form = NestedArray::getValue($form, array_slice($element['#array_parents'], 0, 4)); $inline_form = NestedArray::getValue($form, array_slice($element['#array_parents'], 0, 4));
$form_mode = $inline_form['#form_mode']; $form_mode = $inline_form['#form_mode'];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment