Commit f040ec9b authored by Steven Stapleton's avatar Steven Stapleton Committed by micropat
Browse files

Issue #3372598 by sstapleton: The "node" entity cannot have a URI as it does...

Issue #3372598 by sstapleton: The "node" entity cannot have a URI as it does not have an ID when editing a display in layout builder
parent 69013516
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ function addtoany_page_attachments(&$page) {
 *   The array with url, title, additional_html that will be send to Twig.
 */
function addtoany_create_entity_data($node, $config = NULL) {
  $url = isset($node) ? $node->toUrl('canonical', ['absolute' => TRUE])->toString() : NULL;
  $url = isset($node) && !$node->isNew() ? $node->toUrl('canonical', ['absolute' => TRUE])->toString() : NULL;
  $title = isset($node) && $node->access('view label') ? $node->label() : NULL;
  return addtoany_create_data($url, $title, $config);
}