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 #3240883: Incorrect system action label)
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';
Issue fork replicate_ui-3372362
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
acbramley commentedSorry, meant to be in Replicate UI.
Comment #3
acbramley commentedStill needs tests but here we go.
Comment #5
acbramley commentedActually this whole action is broken.
This is a recursive loop, ActionBase::executeMultiple does this:
Comment #6
rcodinaThe patch from the MR works like a charm!
Comment #7
anybodyNice work @acbramley! Works like a charm. Still this has the "Needs tests" tag - would you like to move it back to NW and add the missing tests or how to proceed?
Comment #8
anybodyThank you all! Merged!
Comment #10
acbramley commentedIt doesn't look like the commit was pushed?
Comment #12
berdirMerged it now.
@Anybody: Looks like your other merges also didn't happen. I also recommend using the new commit format, update the contribution record first and then copy the commit message there.
Comment #14
anybodyThanks @berdir indeed. I used the merge train and it looks like it failed, sorry... Seems to have been Deutsche Bahn, not reliable Swiss Rhätische Bahn ;)