Accessing data within a block element in snippets from documents


#1

Any idea why accessing data within a block element in snippets from documents doesn’t work in pimcore version 5.6.5 ? On all previous versions it worked. What I have is:
$document->getElement(‘content’)->getSnippet(‘snippet’)->getElement(‘content’)->getElement(‘brick1’)[0]->getInput(‘input1’)…

When I change Model\Document\Page::getById(…) to Model\Document::getById(…) https://github.com/pimcore/pimcore/blob/master/models/Document/Tag/Areablock.php#L705 it works. Also here: https://github.com/pimcore/pimcore/blob/3a54ec8b86058c96d27026c071aa351b06180095/models/Document/Tag/Block.php#L390 when accessing directly in snippet.

Error message: “Type error: Argument 1 passed to Pimcore\Model\Document\Tag\Block\AbstractBlockItem::__construct() must be an instance of Pimcore\Model\Document\PageSnippet, null given”


#2

One part is fixed here: https://github.com/pimcore/pimcore/issues/4096.