- Issue created by @Phonoman
- 🇨🇦Canada joseph.olstad
It's possible yes! Just a small bit of code to look at.
src/Plugin/Action/UnpublishCurrentRevisionAction.php: if ($object->getEntityTypeId() === 'node' || $object->getEntityTypeId() === 'media') { src/Plugin/Action/PublishLatestRevisionAction.php: if ($object->getEntityTypeId() === 'node' || $object->getEntityTypeId() === 'media') {
Try changing these to add an || with 'block_content'
so something like this:
src/Plugin/Action/UnpublishCurrentRevisionAction.php: if ($object->getEntityTypeId() === 'node' || $object->getEntityTypeId() === 'media' || $object->getEntityTypeId() === 'block_content') { src/Plugin/Action/PublishLatestRevisionAction.php: if ($object->getEntityTypeId() === 'node' || $object->getEntityTypeId() === 'media' || $object->getEntityTypeId() === 'block_content')
- 🇱🇻Latvia Phonoman
Did some more tinkering and I also needed to manually create new action configs (similar to media ones coming from this module) so that actions appear for
block_content
bulk views. However, those appeared only for theblock_content
specific bulk operations and not the Global VBO like what(Un)PublishLatestRevisionAction.php
actions offer. This is making the module a tad confusing, IMO.I ended up changing both file annotations
@Action("type" = "block_content")
to getblock_content
Global VBO actions. Seems to work without any extra code changes.We also didn't want "Unpublish" action to put content into "Draft", but adjusting the "draft" to "unpublished" with a local patch was easy enough (having this configurable would probably be useful for others as well).
Have you guys considered renaming
PublishLatestRevisionAction
toPublishLatestNodeRevisionAction
and creating two extras that simply extend it -PublishLatestMediaRevisionAction
;PublishLatestBlockContentRevisionAction
? That way Global VBO could be populated for those entities on top of the entity-specific bulk options. - 🇨🇦Canada joseph.olstad
all that can be done in a merge request. Feel free to rename and add configurations.