Created on 21 February 2023, over 1 year ago
Updated 23 November 2023, 12 months ago

Problem/Motivation

For edit there is direct link like :

/paragraphs_edit/node/{{ nid }}/paragraphs/{{ id }}/edit

I would like to have also delete link, is that possible to implement ? - When I visit the paragraph with above link ,the delete button is missing there so delete button would be nice to have or any direct link if possible.

When I tried to reach link :
/paragraphs_edit/node/{{ nid }}/paragraphs/{{ id }}/delete delete instead of edit there is following issue:

Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'canonical' found for the 'paragraph' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 196 of/core/lib/Drupal/Core/Entity/EntityBase.php).

πŸ“Œ Task
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

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

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany a.dmitriiev

    a.dmitriiev β†’ made their first commit to this issue’s fork.

  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • @admitriiev opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡©πŸ‡ͺGermany a.dmitriiev

    According to this comment https://www.drupal.org/project/paragraphs/issues/3238515#comment-14951479 πŸ’¬ No link template 'canonical' found for the 'paragraph' entity type Fixed each module is responsible to check whether canonical url exists for paragraphs. So for delete form this should be checked inside the module. Please review MR

  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • πŸ‡©πŸ‡ͺGermany a.dmitriiev

    I found one more issue, when deleting paragraph that is a child of another paragraph. The shouldCreateNewRevision should be checked on root parent and not immediate parent of the paragraph. MR was updated

  • Status changed to Postponed: needs info 12 months ago
  • πŸ‡³πŸ‡±Netherlands timohuisman Leiden, Netherlands

    I'm not sure that I understand the problem, is the issue summary up-to-date? I've just tested the url /paragraphs_edit/node/{{ nid }}/paragraphs/{{ id }}/delete and I was able to delete a existing paragraph. Could you provide more detailed steps to reproduce this issue?

  • Status changed to Needs review 12 months ago
  • πŸ‡©πŸ‡ͺGermany a.dmitriiev

    My setup:

    • Drupal 10.1.6
    • Paragraphs 8.x-1.16
    • Paragraph Edit 8.x-2.0

    Try to open url like this /paragraphs_edit/node/122/paragraphs/5923/delete and you will see this error:

    Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'canonical' found for the 'paragraph' entity type in Drupal\Core\Entity\EntityBase->toUrl() (Zeile 196 in /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php).

    This is happening due to getCancelUrl that calls by default $entity->toUrl() that has 'canonical' as default argument. And Paragraphs do not have 'canonical' template.

    Make sure that your installation has no modules that overwrite the Paragraph Delete Form, like frontend_editing.

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I can confirm the error.
    It happens if the delete route for paragraphs doesn't have destination query parameter.

Production build 0.71.5 2024