EntityReplicate action ::access is broken

Created on 5 July 2023, almost 2 years 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

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia acbramley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024