Closed (fixed)
Project:
AddToAny Share Buttons
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 May 2020 at 12:44 UTC
Updated:
15 Nov 2023 at 08:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Haddaway commentedIn my case problem here:
The
$nodeparameter is an instance of Paragraph so we need to go to the host entity.Here's a quick fix use it at your own risk.
Comment #3
Haddaway commentedAvoids paragraphs module dependencies.
Comment #4
avpadernoComment #5
omarlopesinoUpdating the patch to cover this use cases:
Comment #6
samar.alazzeh commented#5 worked fine, Thank you
Comment #7
harshkundaliya commented#5 reviewed and tested on my system. Works fine. Marking it as RTBC
Comment #8
nikolaatExtend #5 with check for node->id because, toUrl method is throwing error if node is not created and doesn't have id. Case scenario when user want to preview node.
Comment #9
Syntapse commentedI saw this same error adding an image to a accordion section. Im just adding
<img/>element to text body as a workaround.Comment #10
kumar rakesh commentedsame error i'm getting in drupal 9.3 version.
i am using paragraph module , i have created an view of paragraph and using fields image and text when i try to link image with content then the module has throw an exception that is ....Below -
Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'canonical' found for the 'paragraph' entity type in Drupal\Core\Entity\EntityBase->toUrl()
issue described by me above is related to paragraph module. if any patch implemented for this issue please tell about that.
Thank You.
Comment #11
JennBina commentedThis is a newbie question, but where do we insert the #5 patch?
Comment #12
eugen zerr@JennBina you'll need a composer based project.
See: https://devdocs.magento.com/guides/v2.4/comp-mgr/patching/composer.html
Comment #13
Bmuskan commentedReplace the code of addtoany.module file below code :
Comment #14
dpiTheres something critically wrong with the patch. How is it the case that this statement is ever true?
while ($node instanceof EntityInterface && $node->getEntityTypeId() == 'paragraph') {$node should only ever be a
NodeInterface.Unless
addtoany_create_entity_datais truely supposed to be able to handle any entity type, then the entire function signature and documentation needs to change to take any arbitrary entity type.So
function addtoany_create_entity_data($node, $config = NULL) {changes tofunction addtoany_create_entity_data(ContentEntityInterface $entity, $config = NULL) {After which the entire function should be guarded/early-return with a link template check:Comment #15
ghuygens commentedComment #16
avpadernoComment #17
jnettikI've updated the patch in #15. Mostly by adding some type casting to the $entity object that gets passed in and adding some commenting around the changes. That should simplify some of the conditional logic happening in the function.
Comment #18
martin nikolov commentedThe paragraphs can be nested inside another paragraphs. Here is patch version that handle this case as well.
https://www.drupal.org/files/issues/2023-06-06/addtoany-no-link-template...
Comment #21
micropat commentedFixes in the latest releases, including the
2.0.xbranch.