Skip to content
Snippets Groups Projects

3362808 - Skip node without id

1 file
+ 5
0
Compare changes
  • Side-by-side
  • Inline
@@ -26,6 +26,11 @@ class JsonLdHeadFormatter extends FormatterBase {
@@ -26,6 +26,11 @@ class JsonLdHeadFormatter extends FormatterBase {
$elements = ['#attached' => ['html_head' => []]];
$elements = ['#attached' => ['html_head' => []]];
$entity = $items->getEntity();
$entity = $items->getEntity();
 
// Skip adding jsonld schema for non saved yet entity.
 
if ($entity->isNew()) {
 
return [];
 
}
 
// When there is no item, default to the configured values without any
// When there is no item, default to the configured values without any
// overrides. See JsonLdItem::isEmpty().
// overrides. See JsonLdItem::isEmpty().
if (count($items) === 0) {
if (count($items) === 0) {
Loading