Skip to content

Commit

Permalink
Issue with matrikula field on multipage form
Browse files Browse the repository at this point in the history
  • Loading branch information
juuliabellcom committed Jun 9, 2020
1 parent 2608433 commit 38424e6
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ private static function getMatrikulaOptions($addressValue, array $element) {
*/
public static function matrikulaUpdateSelectOptions(array &$form, FormStateInterface $form_state) {
$triggeringElement = $form_state->getTriggeringElement();
$parents = $triggeringElement['#parents'];
$parentName = $parents[count($parents) - 2];

return $form['elements'][$parentName]['matrikula'];
$parents = $triggeringElement['#array_parents'];
$matrikula_element = $form;
for ($i=0; $i<=count($parents) - 2; $i++) {
$matrikula_element = $matrikula_element[$parents[$i]];
}
return $matrikula_element['matrikula'];
}

}

0 comments on commit 38424e6

Please sign in to comment.