-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/improve dataobject block behaviour #15927
Fix/improve dataobject block behaviour #15927
Conversation
… like block When we have block inside brick, we do not have enough information inside nested input field or option provider;
Review Checklist
|
…not attached to object In case when block is attached to brick, and there is field with same name on object we got exception or wrong data
03e5fd0
to
4dc66d2
Compare
I'm not sure do you treat this as bugfix or improvement; let me know if i need change target branch |
Kudos, SonarCloud Quality Gate passed! |
@@ -1513,6 +1513,12 @@ public static function enrichLayoutDefinition(&$layout, $object = null, $context | |||
if (method_exists($layout, 'getChildren')) { | |||
$children = $layout->getChildren(); | |||
if (is_array($children)) { | |||
// Send information when we have block or similar element | |||
if ($layout instanceof \Pimcore\Model\DataObject\ClassDefinition\Data && empty($context['subContainerType'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving the assignment outside getChildren
scope and add condition for Block specific type next to localize fields and classificationstore? as it will eventually call enrichLayoutDefinition
on children as well.
$context['ownerName'] = 'localizedfields';
} elseif ($layout instanceof DataObject\ClassDefinition\Data\Block && isset($context['containerType'])) {
$context['subContainerKey'] = $layout->getName();
$context['subContainerType'] = $layout->getFieldtype();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gjorgic please see
@gjorgic I would treat this as bug fix since the context info is missing so the current branch is fine 😊 |
@gjorgic friendly reminder 😺 |
@gjorgic thanks! Please feel free to provide a follow up for the requested change #15927 (comment). |
* update: add more context information in case we have structured input like block When we have block inside brick, we do not have enough information inside nested input field or option provider; * fix: do not try access block data on object if we know that input is not attached to object In case when block is attached to brick, and there is field with same name on object we got exception or wrong data
WHAT
I notice few issues with dataobject block