- First commit to issue fork.
- @abhaisasidharan opened merge request.
When a block type has a media reference field that is using the media_library
form widget (which opens a browser at the /media-library
route), this exception is thrown when one tries to switch an image in a block placed via the section library:
Non-reusable blocks must set an access dependency for access control.
this happens because the access controller for media library checks access for updating the block, but since the block has no usage yet (as the layout hasn't been saved) the code in SetInlineBlockDependency::getInlineBlockDependency
returns null, which triggers the exception:
protected function getInlineBlockDependency(BlockContentInterface $block_content) {
$layout_entity_info = $this->usage->getUsage($block_content->id());
if (empty($layout_entity_info)) {
// If the block does not have usage information then we cannot set a
// dependency. It may be used by another module besides layout builder.
return NULL;
}
A temporary workaround is to immediately save the layout after adding sections from the library, and only then come back and try to swap images via the media library.
If cloned blocks aren't saved when a section is placed in a layout, then the media library and layout builder check access for create rather than update, and this error is avoided.
Closed: duplicate
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.