function test_theme_settings_form_system_theme_settings_submit

Same name and namespace in other branches
  1. 9 core/modules/system/tests/themes/test_theme_settings/theme-settings.php \test_theme_settings_form_system_theme_settings_submit()
  2. 8.9.x core/modules/system/tests/themes/test_theme_settings/theme-settings.php \test_theme_settings_form_system_theme_settings_submit()
  3. 11.x core/modules/system/tests/themes/test_theme_settings/theme-settings.php \test_theme_settings_form_system_theme_settings_submit()

Test theme form settings submission handler.

1 string reference to 'test_theme_settings_form_system_theme_settings_submit'
test_theme_settings_form_system_theme_settings_alter in core/modules/system/tests/themes/test_theme_settings/theme-settings.php
Implements hook_form_system_theme_settings_alter().

File

core/modules/system/tests/themes/test_theme_settings/theme-settings.php, line 44

Code

function test_theme_settings_form_system_theme_settings_submit(&$form, FormStateInterface $form_state) {
  if ($file_id = $form_state->getValue([
    'custom_logo',
    '0',
  ])) {
    $file = File::load($file_id);
    $file->setPermanent();
    $file->save();
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.