EntityReplicate action is broken

Created on 5 July 2023, 12 months ago

Problem/Motivation

When attempting to execute the replicate action, access is denied. This is because EntityReplicate::access creates a route with a path that is the $entity_type_id, in node's case this translates to /node which returns neutral from the 2 fake routes in ReplicateAccessChecker::access.

Steps to reproduce

Try to use the Replicate action (called Delete in the latest stable version, see πŸ› Incorrect system action label Fixed )

Proposed resolution

While I don't fully understand why access is setup this way (we could simply do $object->access() chaining), a simple fix is copying what the RouteSubscriber does and use

        $base_path = $entity_type->getLinkTemplate('canonical');
        $path = $base_path . '/replicate';
πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024