Search by

roblib / node-media-action

Roblib

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

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

dev-main 2026-09-14 19:08 UTC

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

  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_.