diff --git a/CHANGELOG.md b/CHANGELOG.md index bbaf66e..27ef556 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +- Fix bug in MitidChildrenSelectAjaxBehaviour.php [192](https://github.com/OS2Forms/os2forms/pull/192) + ## [4.1.0] 2025-06-03 - [PR-176](https://github.com/OS2Forms/os2forms/pull/176) diff --git a/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php b/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php index e88c218..c38f94c 100644 --- a/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php +++ b/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php @@ -45,6 +45,10 @@ public static function mitidChildrenSelectAjax(array &$form, FormStateInterface if ($cprPlugin->isReady()) { $cprLookupResult = $cprPlugin->lookup($childCpr); + if (!$cprLookupResult->isSuccessful()) { + return $response; + } + /** @var \Drupal\webform\WebformSubmissionForm $webformSubmissionForm */ $webformSubmissionForm = $form_state->getFormObject(); /** @var \Drupal\webform\WebformSubmissionInterface $webformSubmission */