Skip to content

Commit

Permalink
FIX Elemental non-inline editing
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 30, 2024
1 parent a46c745 commit 790c561
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Form/Traits/LinkFieldGetOwnerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ private function getOwnerFields(): array
$relation = $this->getName();
// Elemental content block
if (class_exists(BaseElement::class) && is_a($owner, BaseElement::class)) {
// Remove namespaces from inline editable blocks
// This will return an empty array for non-inline editable blocks (e.g. blocks in a gridfield)
$arr = ElementalAreaController::removeNamespacesFromFields([$relation => ''], $owner->ID);
$relation = array_keys($arr)[0];
if (array_key_exists(0, $arr)) {
$relation = array_keys($arr)[0];
}
}
return [
'ID' => $owner->ID,
Expand Down

0 comments on commit 790c561

Please sign in to comment.