- 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.7last update
almost 2 years ago Waiting for branch to pass - Status changed to Needs review
almost 2 years ago 3:45pm 24 April 2023 - π©πͺ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.7last update
almost 2 years ago Waiting for branch to pass - Open on Drupal.org βCore: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
almost 2 years ago Waiting for branch to pass - Open on Drupal.org βCore: 9.5.x + Environment: PHP 7.4 & MySQL 5.7last update
almost 2 years 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
over 1 year ago 1:21pm 22 November 2023 - π³π±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
over 1 year ago 8:09am 23 November 2023 - π©πͺ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 havedestination
query parameter. - π³π±Netherlands bbrala Netherlands
Reading the code im a little confused why the ->delete was added. Wasn't it deleting before but only unlinking?
- π©πͺGermany a.dmitriiev
It was only unlinking the paragraph from the host (parent) entity. If you check the class
ContentEntityDeleteForm
insubmitForm
there is a line$entity->delete()
. ButParagraphDeleteForm
overwrites this method but doesn't implementdelete()
, so the paragraph is still there. - π³π±Netherlands bbrala Netherlands
Hmm, fair enough. But what if a paragraph is linked to another entity? This would mean delete for all. That feels dagerous.
- π©πͺGermany a.dmitriiev
Paragraph is not a re-usable entity, because it has a parent and a parent field defined in the base fields of paragraph itself, so theoretically it can't be added to another entity. I am not sure how paragraphs library works, though. This needs to be confirmed.