Skip to content

Commit bb6b90b

Browse files
authored
Merge pull request #82 from OS2Forms/f/cprfetchdata-ajax-error
F/cprfetchdata ajax error
2 parents 1c87f1d + fa02e4d commit bb6b90b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa
1111

1212
## [Unreleased]
1313

14+
- CprFetchData adding ajax error fix
15+
1416
## [3.14.0]
1517

1618
- [OS-64] Setting a standard value for Automatic purge [#80](https://github.com/OS2Forms/os2forms/pull/80)

modules/os2forms_nemid/src/Element/NemidCprFetchData.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ class NemidCprFetchData extends CompositeFetchDataBase {
1515
public static function getCompositeElements(array $element) {
1616
$elements = parent::getCompositeElements($element);
1717

18-
// Pattern for CPR.
19-
$elements[self::getValueElementName()]['#pattern'] = '\d{6}(-)?\d{4}';
18+
if ($element) {
19+
// Pattern for CPR.
20+
$elements[static::getValueElementName()]['#pattern'] = '\d{6}(-)?\d{4}';
21+
}
2022

2123
return $elements;
2224
}

0 commit comments

Comments
 (0)