Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
6 May 2013 at 09:17 UTC
Updated:
29 Jul 2014 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
vijaycs85Initial patch...
Comment #2
vijaycs85Adding the controller class that is missing in #1
Comment #3
amateescu commentedMissing an empty line here.
Config should be injected.
This should use RedirectResponse.
Comment #4
oenie commentedI'm taking up this issue and joining it with issue #1987852: Convert system_theme_enable() to a new style controller
Comment #5
oenie commentedamateescu,
You mention in comment #3 that the config should be injected.
I'm trying to find an example for this, but can't seem to find anything useful.
I tried injecting a ConfigFactory, but then i end up with the next error:
Drupal\Core\Config\ConfigImporterException: config.installer is already importing in Drupal\Core\Config\ConfigImporter->import() (line 219 of /Users/Jeroen/development/drupal/core/lib/Drupal/Core/Config/ConfigImporter.php)Do you have any pointers or examples of where to look ?
Thanks !
Comment #6
amateescu commentedSure, you can use this one as an example:
StatisticsSettingsForm::create().If that doesn't work out, could you post your patch anyway so more people can help you debug it? It's also possible that this might be a bug coming from this newly committed issue #1890784: Refactor configuration import and sync functions.
Comment #7
oenie commentedHere's my current patch, which to me seems rather complete, but ends up with the error mentioned in comment #5.
Maybe i'm missing something ?
Comment #9
cosmicdreams commentedHere's a patch that implements a proper constructor and implements the ControllerInterface. As a result, I'm injecting the config factory and using in the disable() function.
Comment #10
kim.pepperNeeds comment
Should $config = $this->configFactory->get('system.theme');
Comment #11
cosmicdreams commentedIn #7, I"m not getting the right set of config. This patch gets system.theme config properly.
Comment #12
amateescu commented@cosmicdreams, this issue was assigned to @oenie and he is working on it..
@oenie, I applied the patch locally (after fixing the conflict in system.routing.yml) and theme enabling/disabling works just fine, no errrors at all :) Let's try to feed the testbot an updated patch.
PS. I also fixed some trailing whitespaces and code style errors. Interdiff is to #7.
Comment #13
dawehnerLet's just inject the system.theme config object and not the full factory
/me hides ... single quotes.
Let's get rid of it ... they are menu callbacks.
Comment #14
oenie commentedAnother try, including dawehner's comments.
I've attached an interdiff to the patch of comment 11
Comment #15
oenie commentedLet's try that again as a patch.
Another try, including dawehner's comments.
I've attached an interdiff to the patch of comment #12 by amateescu
Comment #17
oenie commented#15: 1987850-route-system-theme-disable-12.patch queued for re-testing.
Comment #18
oenie commentedReroll of the patch against the current code.
Learning a bunch of new stuff :)
Comment #19
cosmicdreams commentedLooks great!
Comment #20
alexpottCommitted f94711c and pushed to 8.x. Thanks!