Loading entity_clone.module +1 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ function entity_clone_entity_type_build(array &$entity_types) { * @see \Drupal\Core\Entity\EntityListBuilderInterface::getOperations() */ function entity_clone_entity_operation(EntityInterface $entity) { if ($entity->hasLinkTemplate('clone-form') && $entity->access('clone')) { if ($entity->hasLinkTemplate('clone-form') && $entity->access('clone') && !$entity->isNew()) { return [ 'clone' => [ 'title' => t('Clone'), Loading src/Form/EntityCloneForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class EntityCloneForm extends FormBase { */ protected function formSetRedirect(FormStateInterface $form_state, EntityInterface $entity) { if ($entity && $entity->hasLinkTemplate('canonical')) { $form_state->setRedirect($entity->toUrl()->getRouteName(), $entity->toUrl()->getRouteParameters()); $form_state->setRedirect($entity->toUrl('canonical')->getRouteName(), $entity->toUrl('canonical')->getRouteParameters()); } else { $form_state->setRedirect('<front>'); Loading Loading
entity_clone.module +1 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ function entity_clone_entity_type_build(array &$entity_types) { * @see \Drupal\Core\Entity\EntityListBuilderInterface::getOperations() */ function entity_clone_entity_operation(EntityInterface $entity) { if ($entity->hasLinkTemplate('clone-form') && $entity->access('clone')) { if ($entity->hasLinkTemplate('clone-form') && $entity->access('clone') && !$entity->isNew()) { return [ 'clone' => [ 'title' => t('Clone'), Loading
src/Form/EntityCloneForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class EntityCloneForm extends FormBase { */ protected function formSetRedirect(FormStateInterface $form_state, EntityInterface $entity) { if ($entity && $entity->hasLinkTemplate('canonical')) { $form_state->setRedirect($entity->toUrl()->getRouteName(), $entity->toUrl()->getRouteParameters()); $form_state->setRedirect($entity->toUrl('canonical')->getRouteName(), $entity->toUrl('canonical')->getRouteParameters()); } else { $form_state->setRedirect('<front>'); Loading