Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#31 | config.admin-theme.31.patch | 11.73 KB | sun |
#28 | 1798872_admin_theme_28.patch | 11.36 KB | vijaycs85 |
#25 | 1798872_admin_theme_25.patch | 11.47 KB | vijaycs85 |
#21 | 1798872_admin_theme_21.patch | 11.54 KB | vijaycs85 |
#19 | 1798872_admin_theme_19.patch | 11.54 KB | pcambra |
Comments
Comment #1
andreiashu CreditAttribution: andreiashu commentedI'm a bit confused that in system_themes_page() in system.admin.inc this variable defaults to int 0 (
$admin_theme = variable_get('admin_theme', 0);
and later on we compare it with string '0' (if ($theme->name == $admin_theme || ($theme->is_default && $admin_theme == '0')) {
.Keeping in mind that in PHP "0" != '' when I convert this variable to CMI I'll probably have initialise the default value to '' somewhere in system.site.yml which will make the above if statement fail?
Comment #2
andreiashu CreditAttribution: andreiashu commenteda first stab. Something for testbot to chew
Comment #3
andreiashu CreditAttribution: andreiashu commentedTagging
Comment #4
andreiashu CreditAttribution: andreiashu commentednot cool... Although I didn't address the issue in #1 the tests passed which means that actually #1 is a non issue or we simply don't have a test for that. will investigate
Comment #5
leschekfm CreditAttribution: leschekfm commentedI did a bit of research and found out that the value that gets saved by the ui is '0'. Providing a default value with
config('system.site')->get('admin_theme') ?: 0
has a bad side effect. As the $admin_theme variable now is an integer the comparison$theme->name == $admin_theme
tries to cast $theme->name also to an integer. A non numerical string gets evaluated to 0, which in the end results for the comparison to evaluate to TRUE.I've adjusted the patch accordingly. Otherwise the patch looks fine.
Please review :)
Comment #6
leschekfm CreditAttribution: leschekfm commentedComment #7
penyaskitoThis needs an upgrade path.
Comment #8
leschekfm CreditAttribution: leschekfm commentedAdded upgrade path
Comment #9
leschekfm CreditAttribution: leschekfm commentedComment #10
penyaskitoWhy is this moved to CoreBundle.php? It was by accident? I don't get it :/
Comment #11
pcambraRemoved the change that moved the register to CoreBundle.php and rerolled.
Comment #13
leschekfm CreditAttribution: leschekfm commented@penyaskito: I have no idea how that happened...
Comment #14
penyaskitoThis is funny: it's a problem when we are merging the previous config and the default config.
It uses \Drupal\Component\Utility\NestedArray::mergeDeepArray, which modifies the numeric keys.
I created #1831038: Upgrade fails updating 403 and 404 pages for tracking that.
Comment #15
alexpottThis is blocked by #1825466: Allow NestedArray::mergeDeepArray() to preserve integer keys
Comment #16
pcambraNot blocked anymore
Comment #17
pcambra#11: 1798872_admin_theme_11.patch queued for re-testing.
Comment #19
pcambraRerolled!
Comment #20
ACF CreditAttribution: ACF commentedthe update number just needs to be brought up to date then it should be RTBC.
Comment #21
vijaycs85Re-rolling with update_N
Comment #22
vijaycs85Comment #24
vijaycs85#21: 1798872_admin_theme_21.patch queued for re-testing.
Comment #25
vijaycs85Updating config value and update_N.
Comment #26
ACF CreditAttribution: ACF commentedThis looks fine, should be good to go.
Comment #27
ACF CreditAttribution: ACF commentedsorry jumped too soon.
Not sure why the second line has changed from admin_theme != 0 to $admin_theme, surely that changes the logic.
Comment #28
vijaycs85Updating review comment changes.
Comment #29
ACF CreditAttribution: ACF commentedCool this now looks ready to go.
Comment #30
catchThanks! Committed/pushed to 8.x.
Comment #31
sunmmm... this was supposed to go into the
system.theme
config object :-/Sorry, I think that wasn't documented or stated anywhere.
Essentially, system.theme is envisioned to look like this in the end:
As a result, all configuration values that are necessary to initialize the theme are contained in the single system.theme config object.
Attached patch moves the setting from system.site into system.theme.
Comment #32
marcingy CreditAttribution: marcingy commentedLooks good to me and it makes sense having all theme stuff in one place.
Comment #34
ACF CreditAttribution: ACF commented#31: config.admin-theme.31.patch queued for re-testing.
Comment #35
sunThanks - testbot hiccup, back to RTBC.
Comment #36
catchYes that does make more sense in there, I can see both of these configuration objects being loaded without the other being necessary.