Skip to content

Commit

Permalink
Merge pull request #151 from gigya/develop
Browse files Browse the repository at this point in the history
1.8.3
  • Loading branch information
Ynhockey authored Aug 8, 2024
2 parents 675cdb8 + f802b9c commit c0c1036
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions gigya_raas/src/Form/GigyaFieldmappingForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
if ($this->jsonFormValidation($fieldmapping_config) !== TRUE) {
$form_state->setErrorByName('fieldmapping', $this->t($this->jsonFormValidation($fieldmapping_config)));
}
if (is_array(json_decode($fieldmapping_config)) and !empty(json_decode($fieldmapping_config))) {
$form_state->setErrorByName('fieldmapping', $this->t('The field mapping configuration cannot be an array. Please follow the <a href="@documentation"><u>documentation</u></a>', ['@documentation.' => 'https://github.com/gigya/drupal8/wiki#field-mapping']));
}

/* Offline sync */

Expand Down
5 changes: 3 additions & 2 deletions gigya_raas/src/Helper/GigyaRaasHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ public function checkProfileEmail($profile_email, $loginIds) {
*/
public function getFieldMappingConfig() {
$config = json_decode(\Drupal::config('gigya_raas.fieldmapping')
->get('gigya.fieldmapping_config') ?? '');
->get('gigya.fieldmapping_config') ?? '');

if (empty($config) or empty(get_object_vars($config))) {
$config = (object) \Drupal::config('gigya.global')
->get('gigya.fieldMapping');
->get('gigya.fieldMapping');
}

return $config;
Expand Down

0 comments on commit c0c1036

Please sign in to comment.