Commit 29262a8e authored by lamlih's avatar lamlih
Browse files

Issue #3264480 by victoria-marina: Error Add Services form

parent a9acd00f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ class AddServices extends ConfigFormBase {

        if (isset($value['code'])) {
          foreach ($value['code'] as $code) {
            if (preg_match_all('/tarteaucitron.user.([A-z]+)[\s]+=[\s]+[\\]?[\"]?[\']?###([^.]+)###/m', $code, $match)) {
            if (preg_match_all('/tarteaucitron.user.([A-z]+)[\s]+=[\s]+[\\]?[\"]?[\']?###([^.]+)###/m', (is_array($code) ? implode(", ", $code) : $code), $match)) {
              for ($i = 0; $i < count($match[1]); $i++) {
                $form['service']['type_' . $type]['details_' . $service]['user_' . $service . '_' . $match[1][$i]] = [
                  '#type' => 'textfield',
@@ -134,7 +134,7 @@ class AddServices extends ConfigFormBase {

        if (isset($value['code'])) {
          foreach ($value['code'] as $code) {
            if (preg_match_all('/tarteaucitron.user.([A-z]+)[\s]+=[\s]+[\\]?[\"]?[\']?###([^.]+)###/m', $code, $match)) {
            if (preg_match_all('/tarteaucitron.user.([A-z]+)[\s]+=[\s]+[\\]?[\"]?[\']?###([^.]+)###/m', (is_array($code) ? implode(", ", $code) : $code), $match)) {
              for ($i = 0; $i < count($match[1]); $i++) {
                $form_state->setValue('user_' . $service . '_' . $match[1][$i], $form_state->getValue('user_' . $service . '_' . $match[1][$i]) ?: NULL);
              }
@@ -166,7 +166,7 @@ class AddServices extends ConfigFormBase {
        
        if (isset($value['code'])) {
          foreach ($value['code'] as $code) {
            if (preg_match_all('/tarteaucitron.user.([A-z]+)[\s]+=[\s]+[\\]?[\"]?[\']?###([^.]+)###/m', $code, $match)) {
            if (preg_match_all('/tarteaucitron.user.([A-z]+)[\s]+=[\s]+[\\]?[\"]?[\']?###([^.]+)###/m', (is_array($code) ? implode(", ", $code) : $code), $match)) {
              for ($i = 0; $i < count($match[1]); $i++) {
                if ($form_state->getValue('user_' . $service . '_' . $match[1][$i])) {
                  $config->set('user.' . $match[1][$i], $form_state->getValue('user_' . $service . '_' . $match[1][$i]));