0

To fully translate a view into one language I have to expand dozens of collapsed panels, most of them with only one or two subelements.

example screenshot

I've reported it here. But is there a quick workaround, like a module or setting that automatically expands all these panels?

I tried using hook_form_FORM_ID_alter but changing the #open value is ignored (note that it's a top-level Displays panel #open which is true by default):

 /**
 * Implements hook_form_FORM_ID_alter().
 */
function custom_admin_form_config_translation_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  foreach ($form['config_names'] as $key => $config_name) {
    if (substr( $key, 0, 1 ) !== '#') {
      $display = $config_name['display'];
      $display['#open'] = false;
    }
  }
}

1 Answer 1

0

It's set to closed at https://git.drupalcode.org/project/drupal/-/blob/8.9.x/core/modules/config_translation/src/FormElement/ListElement.php#L70

by

            '#open' => empty($base_key),

so I'll just add a patch to composer to change it to

            '#open' => true,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.