Skip to content

Commit

Permalink
Merge pull request #155 from gigya/develop
Browse files Browse the repository at this point in the history
1.9.0 (#154)
  • Loading branch information
Ynhockey authored Nov 6, 2024
2 parents c0c1036 + ee82fc5 commit 3806d52
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Through normal pull request process. Please target the `develop` branch.
## License

GPL 2.0 or later, unless stated otherwise in the `LICENSE` file.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "drupal-module",
"description": "Gigya Drupal module",
"license": "GPL-2.0-or-later",
"version": "1.8.2",
"version": "1.9.0",
"authors": [
{
"name": "Yuval Perelman",
Expand Down
4 changes: 2 additions & 2 deletions gigya/gigya.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ type: module
description: 'Gigya core module'
package: Gigya
configure: gigya.admin.form
version: '1.8.1'
core_version_requirement: ^8 || ^9 || ^10
version: '1.9.0'
core_version_requirement: ^8 || ^9 || ^10 || ^11
4 changes: 2 additions & 2 deletions gigya_ds/gigya_ds.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package: Gigya
dependencies:
- gigya
- gigya_raas
version: '1.8.1'
core_version_requirement: ^8 || ^9 || ^10
version: '1.9.0'
core_version_requirement: ^8 || ^9 || ^10 || ^11
4 changes: 2 additions & 2 deletions gigya_raas/gigya_raas.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package: Gigya
configure: gigya.raas.config
dependencies:
- gigya
version: '1.8.1'
core_version_requirement: ^8 || ^9 || ^10
version: '1.9.0'
core_version_requirement: ^8 || ^9 || ^10 || ^11
35 changes: 26 additions & 9 deletions gigya_raas/src/Form/GigyaFieldmappingForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@
use Drupal\gigya\Helper\GigyaHelper;
use Drupal\gigya\Helper\GigyaHelperInterface;
use Drupal\gigya_raas\Helper\GigyaRaasHelper;
use Drupal\Core\Config\TypedConfigManagerInterface;


class GigyaFieldmappingForm extends ConfigFormBase {

private $raas_helper;
private $raas_helper= NULL;

public $api_helper = FALSE;
public $api_helper = NULL;

public function __construct(ConfigFactoryInterface $config_factory) {
parent::__construct($config_factory);

$this->raas_helper = new GigyaRaasHelper();
}

/**
* Gets the configuration names that will be editable.
Expand All @@ -42,8 +38,10 @@ protected function getEditableConfigNames() {
* @return array
*/
public function buildForm(array $form, FormStateInterface $form_state, GigyaHelperInterface $helper = NULL) {
$config = $this->config('gigya_raas.fieldmapping');
$fieldmapping_config = json_encode($this->raas_helper->getFieldMappingConfig(), JSON_PRETTY_PRINT);

if ($this->raas_helper == NULL) {
$this->raas_helper = new GigyaRaasHelper();
}

if ($helper == NULL) {
$this->api_helper = new GigyaHelper();
Expand All @@ -52,6 +50,10 @@ public function buildForm(array $form, FormStateInterface $form_state, GigyaHelp
$this->api_helper = $helper;
}

$config = $this->config('gigya_raas.fieldmapping');
$fieldmapping_config = json_encode($this->raas_helper->getFieldMappingConfig(), JSON_PRETTY_PRINT);


if (!$this->api_helper->checkEncryptKey()) {
$messenger = \Drupal::service('messenger');
$messenger->addWarning($this->t('Please go to Gigya\'s general settings to define a Gigya\'s encryption key.'));
Expand Down Expand Up @@ -126,6 +128,17 @@ public function getFormId() {
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);

if ($this->raas_helper == NULL) {
$this->raas_helper = new GigyaRaasHelper();
}

if ($helper == NULL) {
$this->api_helper = new GigyaHelper();
}
else {
$this->api_helper = $helper;
}

/* Field mapping */

$fieldmapping_config = $form_state->getValue('gigya_fieldmapping_config');
Expand Down Expand Up @@ -212,6 +225,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) {

private function validateMappedUidFieldExists ($form_state, string $uid__field_mapping) {

if ($this->raas_helper == NULL) {
$this->raas_helper = new GigyaRaasHelper();
}

if (!empty($uid__field_mapping) and !$this->raas_helper->doesFieldExist($uid__field_mapping)) {
$form_state->setErrorByName('fieldmapping', $this->t("The UID mapping field does not exist in your database.
Therefore, it is necessary to create the field before proceeding"));
Expand Down
4 changes: 2 additions & 2 deletions gigya_user_deletion/gigya_user_deletion.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ type: module
description: 'Allows permanently deleting users from Gigya and Drupal databases'
package: Gigya
configure: gigya.cron.form
version: '1.8.1'
core_version_requirement: ^8 || ^9 || ^10
version: '1.9.0'
core_version_requirement: ^8 || ^9 || ^10 || ^11
dependencies:
- gigya
- gigya_raas

0 comments on commit 3806d52

Please sign in to comment.