Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jun 2015 at 18:50 UTC
Updated:
11 Aug 2015 at 13:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerI try to figure out why we need a theme token and not just rely on the passed in theme +
\Drupal\Core\Theme\ThemeAccessCheck::accessComment #2
catchComment #3
catch@dawehner I think that only checks if the theme is installed. We don't have a way to check if for example a user can see a particular page (or AJAX response) in the admin theme or not.
Patch.
Comment #4
dawehnerQuick note: We have an API wrapper for that:
\Drupal\Core\Extension\ThemeHandlerInterface::getDefaultComment #6
dawehnerso yeah $this does not work in an ordinary function. ... Let's use \Drupal::service('theme_handler')->getDefault() instead.
Comment #7
claudiu.cristeaComment #8
timmillwoodComment #9
claudiu.cristeaSo fast :)
Comment #10
dawehnerI think it would be cool to have a quick test to ensure that this variable is not always printed out.
Just a quick assumption, I would assume we don't show it at the moment at all.
Comment #11
fabianx commentedYes, a quick test would be great for:
- normal theme
- seven (admin) theme
Looks great, besides that.
Comment #12
wim leersBoth of these are getting the theme name. Let's store it in a variable.
Comment #13
claudiu.cristeaI'm not sure that this test is complete. In fact, I don't understand exactly how to make an Ajax request that uses a different theme than the default. Right now the test is using the classy theme and behaves as expected.
Comment #14
dawehnerYou could for example have a different admin theme + have a route on /admin/... which then should generate the theme token.
Comment #15
claudiu.cristeaComment #16
claudiu.cristeaComment #17
dawehner+1
Added a beta eval
Comment #18
alexpottThis issue is a major task that will improve performance and the disruption it introduces is limited. Per https://www.drupal.org/core/beta-changes, this is a good change to complete during the Drupal 8 beta phase. Committed 767cec2 and pushed to 8.0.x. Thanks!