Skip to content
Snippets Groups Projects

Issue #3470570: Unable to save text format without enabling Markdown filter

Open Malcolm Young requested to merge issue/markdown-3470570:3470570-unable-to-save into 3.0.x
2 files
+ 14
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -176,6 +176,9 @@ class ParserConfigurationForm extends FormBase implements FilterAwareInterface,
@@ -176,6 +176,9 @@ class ParserConfigurationForm extends FormBase implements FilterAwareInterface,
* When an invalid parser or no parser is provided.
* When an invalid parser or no parser is provided.
*/
*/
public function processSubform(array &$element, FormStateInterface $form_state, array &$complete_form) {
public function processSubform(array &$element, FormStateInterface $form_state, array &$complete_form) {
 
$filters = $form_state->getValue('filters');
 
$is_active = $filters['markdown']['status'] ?? NULL;
 
// Keep track of subform parents for the validation and submit handlers.
// Keep track of subform parents for the validation and submit handlers.
$form_state->set('markdownSubformParents', ($parents = isset($element['#parents']) ? $element['#parents'] : []));
$form_state->set('markdownSubformParents', ($parents = isset($element['#parents']) ? $element['#parents'] : []));
$form_state->set('markdownSubformArrayParents', $element['#array_parents']);
$form_state->set('markdownSubformArrayParents', $element['#array_parents']);
@@ -222,14 +225,16 @@ class ParserConfigurationForm extends FormBase implements FilterAwareInterface,
@@ -222,14 +225,16 @@ class ParserConfigurationForm extends FormBase implements FilterAwareInterface,
],
],
]);
]);
// Build vertical tabs that parser and extensions will go into.
if ($is_active) {
$element['ajax']['vertical_tabs'] = [
// Build vertical tabs that parser and extensions will go into.
'#type' => 'vertical_tabs',
$element['ajax']['vertical_tabs'] = [
'#parents' => array_merge($parents, ['vertical_tabs']),
'#type' => 'vertical_tabs',
];
'#parents' => array_merge($parents, ['vertical_tabs']),
 
];
// Determine the group that details should be referencing for vertical tabs.
// Determine the group that details should be referencing for vertical tabs.
$form_state->set('markdownGroup', ($group = implode('][', array_merge($parents, ['vertical_tabs']))));
$form_state->set('markdownGroup', ($group = implode('][', array_merge($parents, ['vertical_tabs']))));
 
}
// Create a subform state.
// Create a subform state.
$subform_state = SubformState::createForSubform($element, $complete_form, $form_state);
$subform_state = SubformState::createForSubform($element, $complete_form, $form_state);
Loading