Creates node-level Actions that execute configured media Actions against media referencing the node.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.6 KiB

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

  1. Copy node_media_action_bridge into web/modules/custom/.

  2. Enable it:

    drush en node_media_action_bridge -y
    drush cr
    
  3. Go to:

    /admin/config/islandora/node-media-actions

  4. Click Add node media action.

  5. 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_of is 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_.