Test One or more fields included in index. Must be keys from the fields object.
One or more fields included in index. Must be keys from the fields object.
'),
];
$add_index['group']['indexes']['fields']['add_row_button'] = IndexFieldButtons::addIndexFieldButton();
- //$add_index['group']['indexes']['add_row_button'] = self::createIndexActionFields();
-
$add_index['group']['indexes']['save_index'] = IndexFieldButtons::submitIndexButton('add_index', NULL);
$add_index['group']['indexes']['cancel_index'] = IndexFieldButtons::cancelIndexButton('cancel_index', NULL);
@@ -65,27 +61,25 @@ public static function addIndex() {
/**
* Create add fields for Data Dictionary Widget.
*/
- public static function addIndexFields() {
+ public static function addIndexFields($current_index_fields) {
+ $id = $current_index_fields ? "field-json-metadata-dictionary-index-fields-new" : "field-json-metadata-dictionary-index-fields";
$add_index_fields['#access'] = FALSE;
$add_index_fields['group'] = [
'#type' => 'fieldset',
'#title' => t('Add new field'),
- '#prefix' => '
',
+ '#prefix' => "
",
'#suffix' => '
',
+ '#markup' => t('
Add a single index field. Must be keys from the fields object.
'),
];
- // $add_index_fields['group']['indexes']['index_fields'] = [
- // '#prefix' => '
',
- // '#suffix' => '
',
- // ];
-
$add_index_fields['group']['indexes']['fields']['name'] = [
'#name' => 'field_json_metadata[0][fields][field_collection][group][name]',
'#type' => 'textfield',
'#title' => 'Name',
];
+
$add_index_fields['group']['indexes']['fields']['length'] = self::createIndexFieldLengthField();
- $add_index_fields['group']['indexes']['fields']['actions'] = self::createIndexActionFields();
+ $add_index_fields['group']['indexes']['fields']['actions'] = self::createIndexActionFields($id);
return $add_index_fields;
}
@@ -104,11 +98,11 @@ private static function createIndexFieldLengthField() {
/**
* Create Action buttons.
*/
- private static function createIndexActionFields() {
+ private static function createIndexActionFields($id) {
return [
'#type' => 'actions',
'save_index_settings' => IndexFieldButtons::submitIndexFieldButton('add', NULL),
- 'cancel_index_settings' => IndexFieldButtons::cancelIndexFieldButton('cancel', NULL),
+ 'cancel_index_settings' => IndexFieldButtons::cancelIndexFieldButton('cancel', NULL, $id),
];
}
}
\ No newline at end of file
diff --git a/modules/data_dictionary_widget/src/Indexes/IndexFieldButtons.php b/modules/data_dictionary_widget/src/Indexes/IndexFieldButtons.php
index 301d5cbf4a..be0f5cfe0a 100644
--- a/modules/data_dictionary_widget/src/Indexes/IndexFieldButtons.php
+++ b/modules/data_dictionary_widget/src/Indexes/IndexFieldButtons.php
@@ -23,8 +23,8 @@ public static function addIndexFieldButton() {
],
],
'#ajax' => [
- 'callback' => '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexformAjax',
- 'wrapper' => 'field-json-metadata-dictionary-index-fields-new',
+ 'callback' => '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexFormAjax',
+ 'wrapper' => 'field-json-metadata-dictionary-index-fields',
'effect' => 'fade',
],
'#limit_validation_errors' => [],
@@ -41,13 +41,13 @@ public static function addIndexButton() {
'#access' => TRUE,
'#op' => 'add_new_index',
'#submit' => [
- [
- '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
- 'indexAddCallback',
- ],
+ [
+ '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
+ 'indexAddCallback',
+ ],
],
'#ajax' => [
- 'callback' => '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::indexformAjax',
+ 'callback' => '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::indexFormAjax',
'wrapper' => 'field-json-metadata-dictionary-indexes',
'effect' => 'fade',
],
@@ -77,7 +77,7 @@ public static function editIndexButtons($indexKey) {
],
],
'#ajax' => [
- 'callback' => '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexformAjax',
+ 'callback' => '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexFormAjax',
'wrapper' => 'field-json-metadata-dictionary-index-fields',
'effect' => 'fade',
],
@@ -97,14 +97,14 @@ public static function submitIndexFieldButton($location, $indexKey) {
'#value' => $value,
'#op' => $op,
'#submit' => [
- [
- '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
- $callbackClass,
- ],
+ [
+ '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
+ $callbackClass,
+ ],
],
'#ajax' => [
- 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexformAjax',
- 'wrapper' => 'field-json-metadata-dictionary-index-fields-new',
+ 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexFormAjax',
+ 'wrapper' => 'field-json-metadata-dictionary-index-fields',
'effect' => 'fade',
],
'#limit_validation_errors' => [],
@@ -128,13 +128,13 @@ public static function submitIndexButton($location, $indexKey) {
'#value' => $value,
'#op' => $op,
'#submit' => [
- [
- '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
- $callbackClass,
- ],
+ [
+ '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
+ $callbackClass,
+ ],
],
'#ajax' => [
- 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::indexformAjax',
+ 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::indexFormAjax',
'wrapper' => 'field-json-metadata-dictionary-indexes',
'effect' => 'fade',
],
@@ -150,7 +150,8 @@ public static function submitIndexButton($location, $indexKey) {
/**
* Create Cancel button.
*/
- public static function cancelIndexFieldButton($location, $indexKey) {
+ public static function cancelIndexFieldButton($location, $indexKey, $id) {
+ $callbackId = ($id === 'field-json-metadata-dictionary-index-fields-new') ? 'subIndexFormExistingFieldAjax' : 'subIndexFormFieldAjax';
$callbackClass = $location == 'edit' ? 'indexEditSubformCallback' : 'indexAddSubformCallback';
$op = $location == 'edit' && $indexKey ? 'abort_' . $indexKey : 'cancel_index_field';
$cancel_index_button = [
@@ -158,14 +159,14 @@ public static function cancelIndexFieldButton($location, $indexKey) {
'#value' => t('Cancel'),
'#op' => $op,
'#submit' => [
- [
- '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
- $callbackClass,
- ],
+ [
+ '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
+ $callbackClass,
+ ],
],
'#ajax' => [
- 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexformAjax',
- 'wrapper' => 'field-json-metadata-dictionary-index-fields',
+ 'callback' => "Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::$callbackId",
+ 'wrapper' => $id,
'effect' => 'fade',
],
'#limit_validation_errors' => [],
@@ -188,13 +189,13 @@ public static function cancelIndexButton($location, $indexKey) {
'#value' => t('Cancel Index'),
'#op' => $op,
'#submit' => [
- [
- '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
- $callbackClass,
- ],
+ [
+ '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
+ $callbackClass,
+ ],
],
'#ajax' => [
- 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::indexformAjax',
+ 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::indexFormAjax',
'wrapper' => 'field-json-metadata-dictionary-indexes',
'effect' => 'fade',
],
@@ -217,13 +218,13 @@ public static function deleteIndexButton($indexKey) {
'#value' => t('Delete index field'),
'#op' => 'delete_' . $indexKey,
'#submit' => [
- [
- '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
- 'indexEditSubformCallback',
- ],
+ [
+ '\Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks',
+ 'indexEditSubformCallback',
+ ],
],
'#ajax' => [
- 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexformAjax',
+ 'callback' => 'Drupal\data_dictionary_widget\Indexes\IndexFieldCallbacks::subIndexFormAjax',
'wrapper' => 'field-json-metadata-dictionary-index-fields',
'effect' => 'fade',
],
diff --git a/modules/data_dictionary_widget/src/Indexes/IndexFieldCallbacks.php b/modules/data_dictionary_widget/src/Indexes/IndexFieldCallbacks.php
index c1b3027900..eb9e5565fd 100644
--- a/modules/data_dictionary_widget/src/Indexes/IndexFieldCallbacks.php
+++ b/modules/data_dictionary_widget/src/Indexes/IndexFieldCallbacks.php
@@ -15,13 +15,8 @@ public static function indexAddSubformCallback(array &$form, FormStateInterface
$trigger = $form_state->getTriggeringElement();
$op = $trigger['#op'];
$current_dictionary_fields = $form["field_json_metadata"]["widget"][0]["dictionary_fields"]["data"]["#rows"];
- //$form_state->set('add_index_field', '');
- //$form_state->set('add_new_index_field', '');
- //$form_state->set('new_index_fields', '');
- // $fields_being_added = $form_state->set('fields_being_added', '');
$current_index = $form["field_json_metadata"]["widget"][0]['indexes']["data"]["#rows"];
- $current_index_fields = $form["field_json_metadata"]["widget"][0]['indexes']["fields"]["data"]["#rows"] ?? NULL;
- //$existing_index_fields = $current_index[0]["fields"];
+ $current_index_fields = $form["field_json_metadata"]["widget"][0]['indexes']["fields"]["data"]["#rows"];
if ($current_index_fields) {
$form_state->set('current_index_fields', $current_index_fields);
@@ -33,7 +28,7 @@ public static function indexAddSubformCallback(array &$form, FormStateInterface
if ($op === 'add_new_index_field') {
$form_state->set('add_index_field', '');
- $add_index_fields = IndexFieldAddCreation::addIndexFields();
+ $add_index_fields = IndexFieldAddCreation::addIndexFields($current_index_fields);
$form_state->set('add_new_index_field', $add_index_fields);
$form_state->set('index_added', FALSE);
$form_state->set('adding_new_index_fields', TRUE);
@@ -63,16 +58,12 @@ public static function indexAddCallback(array &$form, FormStateInterface $form_s
$form_state->set('add_new_index_field', '');
$form_state->set('new_index_fields', '');
$form_state->set('add_new_index', '');
- //$form_state->set('new_index', '');
- //$form_state->set('current_index_fields', '');
- // $fields_being_added = $form_state->set('fields_being_added', '');
$form_state->set('adding_new_index_fields', FALSE);
$current_index = $form["field_json_metadata"]["widget"][0]["indexes"]["data"]["#rows"];
$current_index_fields = $form["field_json_metadata"]["widget"][0]['indexes']["fields"]["data"]["#rows"] ?? NULL;
if ($current_index) {
$form_state->set('current_index', $current_index);
- //$form_state->set('current_index_fields', '');
}
if ($op === 'cancel_index') {
@@ -82,7 +73,6 @@ public static function indexAddCallback(array &$form, FormStateInterface $form_s
if ($op === 'add_new_index') {
$add_new_index = IndexFieldAddCreation::addIndex();
$form_state->set('new_index', '');
- //$form_state->set('current_index_fields', $current_index_fields);
$form_state->set('add_new_index', $add_new_index);
}
@@ -141,16 +131,31 @@ public static function indexEditSubformCallback(array &$form, FormStateInterface
}
/**
- * Ajax callback.
+ * Ajax callback to return index fields.
*/
- public static function subIndexformAjax(array &$form, FormStateInterface $form_state) {
+ public static function subIndexFormAjax(array &$form, FormStateInterface $form_state) {
return $form["field_json_metadata"]["widget"][0]["indexes"]["fields"];
}
/**
- * Ajax callback.
+ * Ajax callback to return indexes.
*/
- public static function indexformAjax(array &$form, FormStateInterface $form_state) {
+ public static function indexFormAjax(array &$form, FormStateInterface $form_state) {
return $form["field_json_metadata"]["widget"][0]["indexes"];
}
+
+ /**
+ * Ajax callback to return index fields fieldset with Add Field button.
+ */
+ public static function subIndexFormFieldAjax(array &$form, FormStateInterface $form_state) {
+ return $form["field_json_metadata"]["widget"][0]["indexes"]["field_collection"]["group"]["indexes"]["fields"];
+ }
+
+ /**
+ * Ajax callback to return index fields fieldset with existing fields and Add Field button.
+ */
+ public static function subIndexFormExistingFieldAjax(array &$form, FormStateInterface $form_state) {
+ $form["field_json_metadata"]["widget"][0]["indexes"]["field_collection"]["group"]["indexes"]["fields"]["add_row_button"]['#access'] = TRUE;
+ return $form["field_json_metadata"]["widget"][0]["indexes"]["field_collection"]["group"]["indexes"]["fields"]["add_row_button"];
+ }
}
\ No newline at end of file
diff --git a/modules/data_dictionary_widget/src/Indexes/IndexFieldCreation.php b/modules/data_dictionary_widget/src/Indexes/IndexFieldCreation.php
index 5d4e5d3a75..22562a66b4 100644
--- a/modules/data_dictionary_widget/src/Indexes/IndexFieldCreation.php
+++ b/modules/data_dictionary_widget/src/Indexes/IndexFieldCreation.php
@@ -12,22 +12,13 @@ class IndexFieldCreation {
public static function createGeneralIndexFields($element, $field_json_metadata, $current_index_fields, $new_index, $index_fields_being_modified) {
$element['indexes']['fields'] = [
- '#access' => TRUE,
- '#type' => 'fieldset',
- '#title' => t('Fields'),
- '#prefix' => '
',
- '#suffix' => '
',
- '#markup' => t('
One or more fields included in index. Must be keys from the fields object.
'),
- ];
-
- // if ($new_index) {
- // $element['indexes']['index_fields']['current_index_fields'] = [];
- // } else {
- // $element['indexes']['index_fields']['current_index_fields'] = $current_index_fields;
- // }
-
-
-
+ '#access' => TRUE,
+ '#type' => 'fieldset',
+ '#title' => t('Fields'),
+ '#prefix' => '
',
+ '#suffix' => '
',
+ '#markup' => t('
One or more fields included in index. Must be keys from the fields object.
'),
+ ];
return $element;
}
@@ -38,12 +29,12 @@ public static function createGeneralIndexFields($element, $field_json_metadata,
public static function createGeneralIndex($element, $field_json_metadata, $current_index, $index_fields_being_modified) {
$element['indexes'] = [
- '#type' => 'fieldset',
- '#title' => t('Data Dictionary Indexes'),
- '#prefix' => '
',
- '#suffix' => '
',
- '#markup' => t('
One or more indexes.
'),
- ];
+ '#type' => 'fieldset',
+ '#title' => t('Data Dictionary Indexes'),
+ '#prefix' => '
',
+ '#suffix' => '
',
+ '#markup' => t('
Adding indexes to your datastore tables can improve response times from common queries.
'),
+ ];
$element['indexes']['current_index'] = $current_index;
@@ -53,32 +44,12 @@ public static function createGeneralIndex($element, $field_json_metadata, $curre
/**
* Create data index data rows.
*/
- public static function createNewIndexFieldsDataRows($current_index_fields, $index_fields_data_results, $index_data_results, $form_state) {
-
- return [
- '#access' => ((bool) $current_index_fields || (bool) $index_data_results || (bool) $index_fields_data_results),
- '#type' => 'table',
- '#header' => ['NAME', 'LENGTH'],
- // '#prefix' => '
',
- // '#suffix' => '
',
- '#rows' => $form_state->get('cancel_index_field') ? $current_index_fields : ($index_fields_data_results ?? []),
- '#tree' => TRUE,
- '#theme' => 'custom_index_fields_table',
- ];
-
- }
-
- /**
- * Create data index data rows.
- */
public static function createIndexFieldsDataRows($index_added, $adding_new_index_fields, $index_field_values, $index_values, $current_index_fields, $index_fields_data_results, $index_data_results, $form_state) {
if ($index_field_values) {
return [
'#access' => ((bool) $current_index_fields || (bool) $index_fields_data_results),
'#type' => 'table',
'#header' => ['NAME', 'LENGTH'],
- '#prefix' => '
',
- '#suffix' => '
',
'#rows' => $form_state->get('cancel_index_field') ? $current_index_fields : ($index_fields_data_results ?? []),
'#tree' => TRUE,
'#theme' => 'custom_index_fields_table',
diff --git a/modules/data_dictionary_widget/src/Indexes/IndexFieldEditCreation.php b/modules/data_dictionary_widget/src/Indexes/IndexFieldEditCreation.php
index af61cefda7..a9567001ff 100644
--- a/modules/data_dictionary_widget/src/Indexes/IndexFieldEditCreation.php
+++ b/modules/data_dictionary_widget/src/Indexes/IndexFieldEditCreation.php
@@ -25,7 +25,6 @@ public static function editIndexFields($indexKey, $current_index_fields) {
'#title' => 'Length',
];
-
$edit_index_fields['update_index_field']['actions'] = self::createIndexActionFields($indexKey);
return $edit_index_fields;
diff --git a/modules/data_dictionary_widget/src/Indexes/IndexFieldOperations.php b/modules/data_dictionary_widget/src/Indexes/IndexFieldOperations.php
index ec90a5b205..bb9d2ec179 100644
--- a/modules/data_dictionary_widget/src/Indexes/IndexFieldOperations.php
+++ b/modules/data_dictionary_widget/src/Indexes/IndexFieldOperations.php
@@ -137,10 +137,6 @@ public static function setAddIndexFieldFormState($add_new_index_field, $new_inde
$element['title']['#required'] = FALSE;
}
-
- // else{
- // $element['indexes']['fields']['#access'] = FALSE;
- // }
return $element;
}
@@ -149,14 +145,13 @@ public static function setAddIndexFieldFormState($add_new_index_field, $new_inde
*/
public static function setAddIndexFormState($add_new_index, $element) {
if ($add_new_index) {
-
- //$element['indexes']['#access'] = FALSE;
$element['indexes']['field_collection'] = $add_new_index;
$element['indexes']['field_collection']['#access'] = TRUE;
$element['indexes']['add_row_button']['#access'] = FALSE;
$element['identifier']['#required'] = FALSE;
$element['title']['#required'] = FALSE;
}
+
return $element;
}
diff --git a/modules/data_dictionary_widget/src/Plugin/Field/FieldWidget/DataDictionaryWidget.php b/modules/data_dictionary_widget/src/Plugin/Field/FieldWidget/DataDictionaryWidget.php
index 6f97cbb5b9..2e0376814b 100644
--- a/modules/data_dictionary_widget/src/Plugin/Field/FieldWidget/DataDictionaryWidget.php
+++ b/modules/data_dictionary_widget/src/Plugin/Field/FieldWidget/DataDictionaryWidget.php
@@ -12,7 +12,6 @@
use Drupal\Core\Entity\EntityFormInterface;
use Drupal\data_dictionary_widget\Indexes\IndexFieldCreation;
use Drupal\data_dictionary_widget\Indexes\IndexFieldOperations;
-use PHPUnit\Framework\Constraint\IsTrue;
/**
* A data-dictionary widget.
@@ -54,7 +53,6 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
$index_fields_results = $field_json_metadata ? $field_json_metadata["data"]["indexes"][0]["fields"] : [];
$index_results = $field_json_metadata ? $field_json_metadata["data"]["indexes"] : [];
-
// Build the data_results array to display the rows in the data table.
$data_results = FieldOperations::processDataResults($data_results, $current_fields, $field_values, $op);
@@ -63,17 +61,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
// Build the index_data_results array to display the rows in the data table.
$index_data_results = IndexFieldOperations::processIndexDataResults($index_results, $current_indexes, $index_values, $index_fields_data_results, $op);
-
- // if ($index_data_results) {
- // unset($current_index_fields);
- // }
-
$element = FieldCreation::createGeneralFields($element, $field_json_metadata, $current_fields, $form_state);
$element = IndexFieldCreation::createGeneralIndex($element, $field_json_metadata, $current_indexes, $form_state);
-
- if ($index_field_values || $current_index_fields) {
- $element = IndexFieldCreation::createGeneralIndexFields($element, $field_json_metadata, $current_index_fields, $form_state->get('add_new_index'), $form_state);
- }
+ $element = IndexFieldCreation::createGeneralIndexFields($element, $field_json_metadata, $current_index_fields, $form_state->get('add_new_index'), $form_state);
$element['dictionary_fields']['#pre_render'] = [
[$this, 'preRenderForm'],
@@ -88,8 +78,6 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
];
$element['dictionary_fields']['data'] = FieldCreation::createDictionaryDataRows($current_fields, $data_results, $form_state);
- //$element["indexes"]["data"]["#rows"][0]["index_fields"];
- //$element['indexes'][] = $index_data_results;
$element['indexes']['data'] = IndexFieldCreation::createIndexDataRows($current_indexes, $index_data_results, $form_state);
$element['indexes']['fields']['data'] = IndexFieldCreation::createIndexFieldsDataRows($index_added, $adding_new_index_fields, $index_field_values, $index_values, $current_index_fields, $index_fields_data_results, $index_data_results, $form_state);
@@ -114,35 +102,18 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
if ($form_entity instanceof FieldableEntityInterface) {
$form_entity->set('field_data_type', 'data-dictionary');
}
+
$element = FieldOperations::setAddFormState($form_state->get('add_new_field'), $element);
-
-
$element = IndexFieldOperations::setAddIndexFormState($form_state->get('add_new_index'), $element);
+ $element = IndexFieldOperations::setAddIndexFieldFormState($form_state->get('add_new_index_field'), $form_state->get('add_index_field'), $element);
- //if (empty($element['indexes'])) {
- $element = IndexFieldOperations::setAddIndexFieldFormState($form_state->get('add_new_index_field'), $form_state->get('add_index_field'), $element);
- //}
-
- // if ($form_state->get('add_new_index_field') || $form_state->get('new_index_fields')) {
- // $element['indexes']['index_fields']['#access'] = TRUE;
- // } else {
- // $element['indexes']['index_fields']['#access'] = FALSE;
- // }
-
+ // Display index fields only when new index fields are being created.
if ($form_state->get('add_new_index_field') || $form_state->get('new_index_fields')) {
$element['indexes']['fields']['#access'] = TRUE;
} else {
$element['indexes']['fields']['#access'] = FALSE;
}
- //$element['indexes']['fields']['#access'] = TRUE;
-
- // if ($adding_new_index_fields ||) {
- // $element['indexes']['fields']['#access'] = TRUE;
- // }
-
-
-
return $element;
}
@@ -152,8 +123,6 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
$current_fields = $form["field_json_metadata"]["widget"][0]["dictionary_fields"]["data"]["#rows"];
$current_indexes = $form["field_json_metadata"]["widget"][0]["indexes"]["data"]["#rows"];
- //$current_indexes = isset($values[0]["indexes"]) ? json_decode($values[0]["indexes"]) : NULL;
-
$field_collection = $values[0]['dictionary_fields']["field_collection"]["group"] ?? [];
$indexes_collection = $values[0]["indexes"]["fields"]["field_collection"]["group"] ?? [];
@@ -181,8 +150,6 @@ public function massageFormValues(array $values, array $form, FormStateInterface
$fields = $current_fields ?? [];
}
-
- //$fields = array_merge($current_fields ?? [], $fields_input);
$indexes = array_merge($current_indexes ?? [], $index_inputs);
$json_data = [
@@ -194,9 +161,7 @@ public function massageFormValues(array $values, array $form, FormStateInterface
],
];
- $test = json_encode($json_data);
-
- return $test;
+ return json_encode($json_data);
}
/**