Skip to content
Snippets Groups Projects
Commit d8c651f3 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3275634 by RenatoG: Save the Replaced ID in the Third Party Settings in the block save

parent defede0a
No related branches found
No related tags found
No related merge requests found
...@@ -801,11 +801,8 @@ class BlockClassHelperService { ...@@ -801,11 +801,8 @@ class BlockClassHelperService {
// Validate class. // Validate class.
$this->validateClass($form, $form_state, $config); $this->validateClass($form, $form_state, $config);
$id_replacement = $form_state->getValue('id')['third_party_settings']['block_class']['replaced_id']; // Validate ID.
$this->validateId($form, $form_state, $config);
$third_party_settings = $form_state->getValue('third_party_settings');
$third_party_settings['block_class']['replaced_id'] = $id_replacement;
} }
...@@ -1058,6 +1055,25 @@ class BlockClassHelperService { ...@@ -1058,6 +1055,25 @@ class BlockClassHelperService {
} }
/**
* Method to validate ID.
*/
public function validateId(&$form, &$form_state, $config) {
// Get the id to be used.
$id_replacement = $form_state->getValue('replaced_id')['third_party_settings']['block_class']['replaced_id'];
// Get the third party settings.
$third_party_settings = $form_state->getValue('third_party_settings');
// Put the Replaced ID.
$third_party_settings['block_class']['replaced_id'] = $id_replacement;
// Set the third party settings.
$form_state->setValue('third_party_settings', $third_party_settings);
}
/** /**
* Method to validate class. * Method to validate class.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment