- π³πΏNew Zealand DanielVeza Brisbane, AU
Can we get some more information about the use-case behind this? :)
Currently a inline block plugin is only duplicated if the parameter $duplicate_block is set to TRUE in the ::saveBlockContent
method.
To currently clone a section component that holds a inline block plugin you must do something like:
// Handle inline blocks.
foreach ($duplicated_section->getComponents() as $component) {
$plugin = $component->getPlugin();
if ($plugin instanceof DerivativeInspectionInterface && $plugin->getBaseId() === 'inline_block') {
$configuration = $plugin->getConfiguration();
if (!empty($configuration['block_revision_id'])) {
$block = \Drupal::entityTypeManager()->getStorage('block_content')->loadRevision($configuration['block_revision_id']);
$duplicated_block = $block->createDuplicate();
$configuration['block_serialized'] = serialize($duplicated_block);
$configuration['block_revision_id'] = NULL;
$component->setConfiguration($configuration);
}
}
Can we simplify this behaviour?
Postponed: needs info
11.0 π₯
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Can we get some more information about the use-case behind this? :)