-
Bug
-
Resolution: Fixed
-
Neutral
-
2.1.4
-
None
Steps to reproduce
- Login to demo Org
- Comment out any block types here: https://demoauthor.magnolia-cms.com/.magnolia/admincentral#app:resources:edit;/travel-demo-stories-app/decorations/stories-app/apps/stories.yaml:edit and here: https://demoauthor.magnolia-cms.com/.magnolia/admincentral#app:resources:edit;/travel-demo-stories-app/decorations/stories-app/apps/stories.yaml:edit
- Go to Stories -> Stories Demo -> Click any story - > Edit Story
- Click + next to any block and click + others
- Notice the page loads all of the blocks registered in the system
Expected results
It should only load the blocks defined in the yaml fileÂ
Actual results
It loads all of the blocks registered in the system
Workaround
Development notes
Upon investigating this, I found that the others button is hard coded to load in every registered block in the system:
    //Add others     menuItem.addItem(i18n.translate("blocks.picker.others"), MagnoliaIcons.ELLIPSIS, openOtherBlockChooserCommand(blockDefinitionConsumer, defaultBlock));
  private MenuBar.Command openOtherBlockChooserCommand(Consumer<BlockDefinition<T>> blockDefinitionConsumer, String defaultBlock) {     return item -> {       BlockChooserDefinition blockChooserDefinition = new BlockChooserDefinition();       blockChooserDefinition.setOptions(buildAllRegisteredBlocksOptions());       blockChooserDefinition.setDefaultBlock(defaultBlock);       blockChooserDefinition.setImplementationClass((Class) BlockChooser.class);       blockChooserDefinition.setLabel(i18n.translate("stories.chooseDialog.label"));       chooserController.openChooser(blockChooserDefinition)                .thenAccept(chosenBlock -> chosenBlock.getChoice()                                   .ifPresent(blockName -> addBlock(blockDefinitionConsumer, blockName)));     };   }  private Options buildAllRegisteredBlocksOptions() {     Map<String, String> blockOptions = getAllRegisteredBlockDefinitions().stream()                                        .filter(def -> StringUtils.isNotBlank(def.getLabel()))                                        .collect(Collectors.toMap(BlockDefinition::getLabel, BlockDefinition::getName));     return new Options(blockOptions);
Â
Acceptance criteria
- clones
-
CONTEDIT-552 Stories Multiblock "Others" button does not obey the yaml definition
- Closed