Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa

## [Unreleased]

- [192](https://github.com/OS2Forms/os2forms/pull/192)
Fix bug in MitidChildrenSelectAjaxBehaviour.php
- [PR-101](https://github.com/OS2Forms/os2forms/pull/101)
- Added support for `os2web_key` in Digital post
- Switched from saving settings in key value store to config, i.e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public static function mitidChildrenSelectAjax(array &$form, FormStateInterface
$webform = $webformSubmission->getWebform();
$elementsFlattened = $webform->getElementsInitializedAndFlattened();

if (!$cprLookupResult->isSuccessful()) {
return $response;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would suggest to put the return right after the initialization, if the result is not successful

or else that can be combined with the IF statement we already have:

something like:
if ($cprPlugin->isReady() && $cprLookupResult = $cprPlugin->lookup($childCpr)) {

foreach ($elementsFlattened as $flattenedElement) {
if (isset($flattenedElement['#type'])) {
$parents = $flattenedElement['#webform_parents'];
Expand Down
Loading