Loading modules/drowl_paragraphs_container2layout/src/ParagraphsConverter.php +19 −9 Original line number Diff line number Diff line Loading @@ -322,10 +322,13 @@ class ParagraphsConverter implements ParagraphsConverterInterface { } $entityTypeStorage = $this->entityTypeManager->getStorage($entity_type); $query = $entityTypeStorage->getQuery(); $query->condition('type', $entity_bundle); $results = $query->execute(); $entities = $entityTypeStorage->loadMultiple($results); if ($entity_type == 'taxonomy_term') { // Taxonomy Terms use "vid" instead of "type" standard sadly due to historic reasons. $entities = $entityTypeStorage->loadByProperties(['vid' => $entity_bundle]); } else { $entities = $entityTypeStorage->loadByProperties(['type' => $entity_bundle]); } if (!empty($entities)) { /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ foreach ($entities as $entity) { Loading Loading @@ -691,9 +694,13 @@ class ParagraphsConverter implements ParagraphsConverterInterface { protected function handleSublevelParagraphs(Paragraph $containerParagraph, EntityReferenceRevisionsFieldItemList $masterEntityReferenceRevisions) { [$layoutName, $positionsArray, $columnWidths, $rows] = $this->determineLayoutAndPositions($containerParagraph); $subParagraphs = []; /** @var \Drupal\entity_reference_revisions\EntityReferenceRevisionsFieldItemList $referencedParagraphs */ if ($containerParagraph->hasField(self::SUBPARAGRAPHS_FIELDNAME)) { $containerSubparagraphsReferenceRevisions = $containerParagraph->get(self::SUBPARAGRAPHS_FIELDNAME); $subParagraphs = $containerSubparagraphsReferenceRevisions->referencedEntities(); } foreach ($subParagraphs as $delta => $subParagraph) { if (!empty($subParagraph->getAllBehaviorSettings()['layout_paragraphs'])) { // Skip this paragraph if it already has layout paragraphs behavior settings. Loading Loading @@ -795,9 +802,12 @@ class ParagraphsConverter implements ParagraphsConverterInterface { $rows = 0; $colPos = 0; $subParagraphs = []; if ($containerParagraph->hasField(self::SUBPARAGRAPHS_FIELDNAME)) { /** @var \Drupal\entity_reference_revisions\EntityReferenceRevisionsFieldItemList $referencedParagraphs */ $containerSubparagraphsReferenceRevisions = $containerParagraph->get(self::SUBPARAGRAPHS_FIELDNAME); $subParagraphs = $containerSubparagraphsReferenceRevisions->referencedEntities(); } $subParagraphsCount = count($subParagraphs); // Following is only required if we have more than one subparagraph. Loading Loading
modules/drowl_paragraphs_container2layout/src/ParagraphsConverter.php +19 −9 Original line number Diff line number Diff line Loading @@ -322,10 +322,13 @@ class ParagraphsConverter implements ParagraphsConverterInterface { } $entityTypeStorage = $this->entityTypeManager->getStorage($entity_type); $query = $entityTypeStorage->getQuery(); $query->condition('type', $entity_bundle); $results = $query->execute(); $entities = $entityTypeStorage->loadMultiple($results); if ($entity_type == 'taxonomy_term') { // Taxonomy Terms use "vid" instead of "type" standard sadly due to historic reasons. $entities = $entityTypeStorage->loadByProperties(['vid' => $entity_bundle]); } else { $entities = $entityTypeStorage->loadByProperties(['type' => $entity_bundle]); } if (!empty($entities)) { /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ foreach ($entities as $entity) { Loading Loading @@ -691,9 +694,13 @@ class ParagraphsConverter implements ParagraphsConverterInterface { protected function handleSublevelParagraphs(Paragraph $containerParagraph, EntityReferenceRevisionsFieldItemList $masterEntityReferenceRevisions) { [$layoutName, $positionsArray, $columnWidths, $rows] = $this->determineLayoutAndPositions($containerParagraph); $subParagraphs = []; /** @var \Drupal\entity_reference_revisions\EntityReferenceRevisionsFieldItemList $referencedParagraphs */ if ($containerParagraph->hasField(self::SUBPARAGRAPHS_FIELDNAME)) { $containerSubparagraphsReferenceRevisions = $containerParagraph->get(self::SUBPARAGRAPHS_FIELDNAME); $subParagraphs = $containerSubparagraphsReferenceRevisions->referencedEntities(); } foreach ($subParagraphs as $delta => $subParagraph) { if (!empty($subParagraph->getAllBehaviorSettings()['layout_paragraphs'])) { // Skip this paragraph if it already has layout paragraphs behavior settings. Loading Loading @@ -795,9 +802,12 @@ class ParagraphsConverter implements ParagraphsConverterInterface { $rows = 0; $colPos = 0; $subParagraphs = []; if ($containerParagraph->hasField(self::SUBPARAGRAPHS_FIELDNAME)) { /** @var \Drupal\entity_reference_revisions\EntityReferenceRevisionsFieldItemList $referencedParagraphs */ $containerSubparagraphsReferenceRevisions = $containerParagraph->get(self::SUBPARAGRAPHS_FIELDNAME); $subParagraphs = $containerSubparagraphsReferenceRevisions->referencedEntities(); } $subParagraphsCount = count($subParagraphs); // Following is only required if we have more than one subparagraph. Loading