After Replicating, Set Author to the Replicator, Not the Previous Author

Created on 12 September 2024, 8 months ago

Problem/Motivation

We've had a request in our context that when an entity is replicated for the author of the newly created entity to be set to the user who did the replicating, rather than the author of the original entity. We have some in our context that one content editor wants to use somebody else's page like a template to start up one of their own.

Our current settings does create an odd loophole where somebody might replicate somebody else's posts, realize they don't need it, but don't have permission to edit or delete it, so the extra content is left public until the original author or an admin can step in. I understand that could be stopped by using the option "Check original entity edit access", but in our context, the ideal would be going the other direction: let them replicate and then let them edit the new entity without being able to edit the original.

Steps to reproduce

Look at a piece of content that you do not own but can replicate. Do the replication. Note the author: it's the same as the original content.

Proposed resolution

I understand this might not be the desired behaviour for every context, so I would see this as an option added to the Replicate Settings screen, to select whether newly-replicated content keeps the original entity's author or is replaced to have the replicating user become the author. That would be a site-wide option, with it applying to all replications afterward.

It could also be an option at the level of each replication, but I imagine that is harder to implement, and at least in our context not really necessary.

Feature request
Status

Active

Version

1.3

Component

Code

Created by

🇨🇦Canada ryanrobinson_wlu

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

Comments & Activities

  • Issue created by @ryanrobinson_wlu
  • 🇬🇧United Kingdom welly

    I'm not sure you've asked this in the correct project? This module doesn't provide a Replicate Settings screen and just provides an API. I think you are referring to Replicate UI as that does provide a settings form. So you'd probably have to ask your question there:

    https://www.drupal.org/project/issues/replicate_ui?status=All&categories...

    Otherwise, if I think this could be done using the cloneEntity() method and setting the uid for the cloned entity to the current user before saving the entity. But I think this is one for replicate_ui module.

Production build 0.71.5 2024