diff -u b/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php --- b/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -238,8 +238,8 @@ // If the display path starts with 'admin/' the page will be // rendered with the Administration theme regardless of the - // 'use_admin_theme' option therefore, we need to set the summary message - // to reflect this. + // 'use_admin_theme' option therefore, we need to set the summary message to + // reflect this. $display_path = $this->getOption('path'); if (!empty($display_path) && stripos($display_path, 'admin/') === 0) { $admin_theme_text = $this->t("Yes (Forced by path)"); @@ -473,9 +473,13 @@ $form['use_admin_theme'] = [ '#type' => 'checkbox', '#title' => $this->t('Use the administration theme'), - '#description' => $this->t('Paths starting with "admin/" use the admin theme even when this option is not checked.'), + '#description' => $this->t('Paths starting with "admin/" uses the admin theme.'), '#default_value' => $this->getOption('use_admin_theme'), ]; + $display_path = $this->getOption('path'); + if (!empty($display_path) && stripos($display_path, 'admin/') === 0) { + $form['use_admin_theme']['#attributes'] = array('disabled' => 'disabled'); + } break; } }