Loading src/Service/BlockClassHelperService.php +20 −0 Original line number Diff line number Diff line Loading @@ -646,6 +646,13 @@ class BlockClassHelperService { $third_party_settings['block_class']['attributes'] = $form_state->getValue('attributes')['third_party_settings']['block_class']['attributes']; } // Remove unused items. unset($third_party_settings['block_class']['add_another_item']); unset($third_party_settings['block_class']['remove_item']); // Clear empty values. $third_party_settings['block_class'] = array_filter($third_party_settings['block_class']); // Set the ThirdPartySettings with the default array. $form_state->setValue('third_party_settings', $third_party_settings); Loading Loading @@ -706,6 +713,16 @@ class BlockClassHelperService { $third_party_settings['block_class']['classes'] = $classes; // Remove unused values from Third Party Settings. foreach ($third_party_settings['block_class'] as $key => $third_party_setting) { // If there is a classes_ we can remove. if (str_contains($key, 'classes_')) { unset($third_party_settings['block_class'][$key]); } } $form_state->setValue('third_party_settings', $third_party_settings); } Loading Loading @@ -778,6 +795,9 @@ class BlockClassHelperService { $third_party_settings['block_class']['attributes'] = $attributes; // Remove the multiple_attributes attributes from ThirdPartySettings. unset($third_party_settings['block_class']['multiple_attributes']); $form_state->setValue('third_party_settings', $third_party_settings); } Loading Loading
src/Service/BlockClassHelperService.php +20 −0 Original line number Diff line number Diff line Loading @@ -646,6 +646,13 @@ class BlockClassHelperService { $third_party_settings['block_class']['attributes'] = $form_state->getValue('attributes')['third_party_settings']['block_class']['attributes']; } // Remove unused items. unset($third_party_settings['block_class']['add_another_item']); unset($third_party_settings['block_class']['remove_item']); // Clear empty values. $third_party_settings['block_class'] = array_filter($third_party_settings['block_class']); // Set the ThirdPartySettings with the default array. $form_state->setValue('third_party_settings', $third_party_settings); Loading Loading @@ -706,6 +713,16 @@ class BlockClassHelperService { $third_party_settings['block_class']['classes'] = $classes; // Remove unused values from Third Party Settings. foreach ($third_party_settings['block_class'] as $key => $third_party_setting) { // If there is a classes_ we can remove. if (str_contains($key, 'classes_')) { unset($third_party_settings['block_class'][$key]); } } $form_state->setValue('third_party_settings', $third_party_settings); } Loading Loading @@ -778,6 +795,9 @@ class BlockClassHelperService { $third_party_settings['block_class']['attributes'] = $attributes; // Remove the multiple_attributes attributes from ThirdPartySettings. unset($third_party_settings['block_class']['multiple_attributes']); $form_state->setValue('third_party_settings', $third_party_settings); } Loading