Skip to content

Commit

Permalink
tweak form pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rloos289 committed Apr 2, 2024
1 parent 4d6fa34 commit dc9b61b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function setCustomData($entity) {
'body' => $entity->get('body')->value,
'field_bann' => $entity->get('field_bann')->value,
'field_banner_color' => $entity->get('field_banner_color')->value,
'field_banner_image' => $this->getReferencedEntity($entity->get('field_banner_image')->referencedEntities()),
'field_confirmation_sidebar' => $this->getReferencedData($entity->get('field_confirmation_sidebar')->referencedEntities()),
'field_departments' => $this->getReferencedEntity($entity->get('field_departments')->referencedEntities()),
'field_description' => $entity->get('field_description')->value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function setCustomData($entity) {
'field_formio_json_content' => $entity->get('field_formio_json_content')->value,
'field_intro_text' => $entity->get('field_intro_text')->value,
'data_source' => $formio_data_source[0]['value']['formio_data_source'],
'confirmation_page' => $this->getReferencedEntity([$this->getFormConfirmationPage($entity->id())]),
'confirmation_page' => $this->getReferencedEntity($this->getFormConfirmationPage($entity->id())),
];
}

Expand All @@ -46,15 +46,17 @@ public function setCustomData($entity) {
* The form confirmation page.
*/
public function getFormConfirmationPage($form_id) {
$node = [];
$query = \Drupal::entityQuery('node')
->accessCheck(FALSE)
->condition('type', 'form_confirmation_page')
->condition('field_related_content_single', $form_id);
$nids = $query->execute();
if (count($nids) > 0) {
$nid = array_shift($nids);
return Node::load($nid);
$node[] = Node::load($nid);
}
return [];
return $node;
}

}

0 comments on commit dc9b61b

Please sign in to comment.