Loading src/Plugin/Block/AddToAnyBlock.php +22 −14 Original line number Diff line number Diff line Loading @@ -24,12 +24,17 @@ class AddToAnyBlock extends BlockBase { $node = \Drupal::routeMatch()->getParameter('node'); if (is_numeric($node)) { $node = Node::load($node); } if ($node instanceof NodeInterface) { $data = addtoany_create_entity_data($node); } } else { $data = addtoany_create_data(); } $build = [ '#addtoany_html' => \Drupal::token()->replace($data['addtoany_html'], ['node' => $node]), '#addtoany_html' => $data['addtoany_html'], '#link_url' => $data['link_url'], '#link_title' => $data['link_title'], '#button_setting' => $data['button_setting'], Loading @@ -41,6 +46,9 @@ class AddToAnyBlock extends BlockBase { 'contexts' => ['url'], ], ]; if ($node instanceof NodeInterface) { $build['#addtoany_html'] = \Drupal::token()->replace($data['addtoany_html'], ['node' => $node]); } return $build; Loading Loading
src/Plugin/Block/AddToAnyBlock.php +22 −14 Original line number Diff line number Diff line Loading @@ -24,12 +24,17 @@ class AddToAnyBlock extends BlockBase { $node = \Drupal::routeMatch()->getParameter('node'); if (is_numeric($node)) { $node = Node::load($node); } if ($node instanceof NodeInterface) { $data = addtoany_create_entity_data($node); } } else { $data = addtoany_create_data(); } $build = [ '#addtoany_html' => \Drupal::token()->replace($data['addtoany_html'], ['node' => $node]), '#addtoany_html' => $data['addtoany_html'], '#link_url' => $data['link_url'], '#link_title' => $data['link_title'], '#button_setting' => $data['button_setting'], Loading @@ -41,6 +46,9 @@ class AddToAnyBlock extends BlockBase { 'contexts' => ['url'], ], ]; if ($node instanceof NodeInterface) { $build['#addtoany_html'] = \Drupal::token()->replace($data['addtoany_html'], ['node' => $node]); } return $build; Loading