Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

replicate_actions

558 sites Security covered
View on drupal.org

While Replicating Nodes using Replicate API and Replicate UI modules, I found that the module will publish a node immediately (shows "view" mode) after replication.
What I would like is for when the replicated a node opens in edit mode so that a content manager can make the necessary changes before publishing it. Otherwise, it creates too many steps for them to go through.

For now, the module makes replicated entities unpublished and makes a redirect to edit mode.

Also, if the Group module is installed, this module checks whether a node has been added to a group and does exactly that.

In the future, incoming versions, I am going to add new functionality and allow doing the same for other entity types and some more actions.

This provides the extension for a simple but powerful Replicate UI.

The full list of what it module does

Unpublish replicated entities

  • Trigger: ReplicatorEvents::REPLICATE_ALTER.
  • Applies to publishable content entities that have a status field.
  • Skips:
    • Paragraph entities (paragraph).
    • Non‑reusable Layout Builder custom blocks (block_content that are not reusable).
  • For all translations:
    • Sets status to unpublished.
    • Resets created/changed timestamps to the current time (when supported).
  • Implementation: src/EventSubscriber/ReplicateSetUnpublished.php (service: replicate_actions.replicate_entity_unpublish).

Set the owner of the replicated entity to the current user

  • Trigger: ReplicatorEvents::REPLICATE_ALTER.
  • For each translation, if the entity supports ownership (setOwnerId), sets the owner to the logged‑in user.
  • Implementation: src/EventSubscriber/ReplicateSetAuthor.php (service: replicate_actions.replicate_set_author).

Redirect to the edit form after replication (Replicate UI)

  • Alters the Replicate UI confirm form to redirect to the new entity’s edit form after submission.
  • Only redirects if the entity has an edit-form link template.
  • Implementation: src/Form/ReplicateFormAlter.php used via hook_form_alter() in replicate_actions.module (service: replicate_actions.replicate_form_alter).

Copy Group memberships for nodes (if Group module is enabled)

  • Stores the original node ID during REPLICATE_ALTER, then, after save (AFTER_SAVE), adds the cloned node to the same Groups as the original.
  • Only runs for nodes and only when the group module is installed.
  • Uses group content plugin ID group_node:{bundle} when adding the relationship.
  • Implementation: src/EventSubscriber/ReplicateNodeToGroup.php (service: replicate_actions.replicate_node_to_group).

Constraints and exclusions

  • Paragraph entities are not auto‑unpublished.
  • Non‑reusable custom blocks from Layout Builder are not auto‑unpublished.
  • Group copying applies only to nodes and requires the Group module.
  • Owner change runs only if the entity supports ownership (setOwnerId).

Files of interest

  • replicate_actions.info.yml — Declares the module; depends on replicate and replicate_ui.
  • replicate_actions.services.yml — Registers the form alter and event subscribers.
  • replicate_actions.module — Contains hook_help() and hook_form_alter().
  • Implementations under src/:
    • EventSubscriber/ReplicateSetUnpublished.php
    • EventSubscriber/ReplicateSetAuthor.php
    • EventSubscriber/ReplicateNodeToGroup.php
    • Form/ReplicateFormAlter.php

🇺🇦

This module is maintained by Ukrainian developers.

Please consider supporting Ukraine in the fight for their freedom and the safety of Europe.

Activity

Total releases
2
First release
Jun 2025
Latest release
7 months ago
Release cadence
78 days
Stability
100% stable

Releases

Version Type Release date
8.x-1.8 Stable Sep 4, 2025
8.x-1.7 Stable Jun 18, 2025