|
|
17 hours ago | |
|---|---|---|
| config/schema | 17 hours ago | |
| src | 17 hours ago | |
| LICENSE | 17 hours ago | |
| README.md | 17 hours ago | |
| composer.json | 17 hours ago | |
| node_media_action_bridge.info.yml | 17 hours ago | |
| node_media_action_bridge.install | 17 hours ago | |
| node_media_action_bridge.links.action.yml | 17 hours ago | |
| node_media_action_bridge.links.menu.yml | 17 hours ago | |
| node_media_action_bridge.permissions.yml | 17 hours ago | |
| node_media_action_bridge.routing.yml | 17 hours ago | |
README.md
Node Media Action Bridge
Drupal 10/11 custom module that creates configured node Actions which delegate to configured media Actions.
For each selected node, the wrapper Action finds all media where:
field_media_of.target_id = NODE_ID
It then checks the underlying media Action's access for each media entity and executes that configured media Action against the allowed media entities.
Installation
-
Copy
node_media_action_bridgeintoweb/modules/custom/. -
Enable it:
drush en node_media_action_bridge -y drush cr -
Go to:
/admin/config/islandora/node-media-actions -
Click Add node media action.
-
Enter the label you want exposed at node level and choose an existing configured media Action.
The module automatically creates a system.action config entity named:
node_media_action_bridge_MACHINE_NAME
That configured Action has type node, so it can be used by VBO/custom Action selectors that load configured node Actions.
Important assumptions
- Related media uses a field named exactly
field_media_of. field_media_ofis an entity-reference field whose target ID is the node ID.- The underlying Action already exists as a configured Drupal Action with type
media.
Access behavior
- The node-level wrapper is available when the current user can update the node.
- Before execution, the wrapper calls the underlying media Action plugin's
access()method for every related media entity. - Only media allowed by the underlying Action are executed.
Uninstall
Uninstalling the module removes generated configured Actions whose IDs start with node_media_action_bridge_.