roblib / node-media-action
Creates node-level Actions that execute configured media Actions against media referencing the node.
Package info
git.library.upei.ca/astanley/node-media-action.git
Type:drupal-module
pkg:composer/roblib/node-media-action
Requires
- drupal/core: ^10.3 || ^11
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-15 08:24:50 UTC
README
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 crGo to:
/admin/config/islandora/node-media-actionsClick 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_.