Problem/Motivation
\Drupal\Core\Entity\EntityInterface
has acreateDuplicate()
method with which other code can create a duplicate of an entity.- Two content entities in core (picture mappings and views) already define their own duplication/cloning operations, and there are numerous entities in contrib that already do the same or will do it in the future and would benefit from this being done by core in a generic way.
Proposed resolution
- Extend
\Drupal\Core\Entity\EntityAccessController
with a check for theduplicate
operation. - Add a link for the
duplicate
operation to\Drupal\Core\Entity\EntityListController
which is only shown if the user has access to duplicate the entity the link is for.
Remaining tasks
None.
User interface changes
None.
API changes
No changes, but a duplicate
entity operation will be introduced and the duplicate-form
link template that is now used by picture mappings will become universal.