Problem/Motivation
Admin paths are defined now in route definitions (see https://www.drupal.org/node/2224207). But in Views UI, the route is build via UI and you'll need to code to mark a view route as admin route. This is very painful.
Use case: As a site moderator, I'm able to use a View, located at /articles/moderate, with VBO to bulk approve/decline articles. I want to access this moderation tool using the admin theme in the same way I'm using the node edit page.
Proposed resolution
Add a new page setting "Use the administration theme" in the page display that allows site builders to make that page an admin one, similar to https://www.drupal.org/project/page_manager.
Remaining tasks
Have the results of the usability review been addressedUpdate screenshots, add links to the issue summary- Update the draft CR with the final screenshots and UI text.
- Commit.
- Publish the CR.
- Rejoice.
User interface changes
View edit page: Page settings

View edit page: Page settings (with an admin/* path)

Modal 'Administration theme' form

Modal 'Administration theme' form (with an admin/* path)

API changes
None.
Data model changes
New page display option: use_admin_theme
| Comment | File | Size | Author |
|---|---|---|---|
| #201 | 2719797-201.patch | 5.72 KB | saurabh-2k17 |
| #190 | 2719797-190.patch | 8.9 KB | dww |
| #144 | 2719797-144-tests-only.patch | 1.92 KB | smustgrave |
Issue fork drupal-2719797
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
claudiu.cristeaHere's a first patch.
Comment #3
claudiu.cristeaComment #4
claudiu.cristeaComment #5
claudiu.cristeaProbably this can be back-ported to Views module.
Comment #7
dawehnerIdeally we would have an update path to set those default values.
This is kind of an advanced option so I was wondering whether the option could be part of an existing form. Any thoughts on that?
Comment #8
claudiu.cristea@dawehner,
Yes I'm thinking on this, but how? Probably the existing views that have page displays with admin routes are set through the code. In this case the only place where this info is stored is the
{router}table. Should we:_admin_routevalue from thereInitially, I thought that should be together with the path/route. But that one is a simple option, so I didn't want to touch that.
Comment #9
claudiu.cristea@dawehner, sorry. You meant to add it as advanced option but ONLY in UI/form. In the storage will remain as simple. That would make sense, yes. So should I add it together with the route/path?
Comment #10
dawehnerNope. Its totally enough to resave the views ..., but note, there should be some code in
\Drupal\views\Plugin\views\display\Page::alterRoutesto copy over previously existing admin route information.I think yeah showing it on the path link is a good idea. Is that advanced that I won't bother to not show anything about it in the summary.
Comment #11
claudiu.cristea@dawehner
I don't get it. So, we are implementing
:: alterRoutes()in Page just to store the admin_theme value in the View? Why not doing this only once, in the update path? Then alterations are able to alter this stored value if they want.Comment #12
claudiu.cristea@dawehner, Thinking more on this, I don't think we need an update path. The existing Views pages showed with the admin theme are resolved right now via route subscribers > route alters. They will continue to do so, unless a site builder manually saves that view. In that case the option is stored and the view will go using the option (if no alter decides something else). Please look at the the interdiff, I'm adding now the
_admin_routeonly if TRUE so that \Drupal\system\EventSubscriber\AdminRouteSubscriber::alterRoutes() will continue to work.Comment #13
claudiu.cristeaComment #14
dawehnerWell its about a 100% complete configuration, rather than relying on the default fallback.
... Adding the needs usability review ...
Comment #15
Bojhan commentedInteresting feature, I can imagine this be useful if your building operational views for authors who don't have admin access. Could you elaborate on the use case?
A few concerns:
Comment #16
claudiu.cristea@Bojhan,
Added in the summary.
No. This new option is stored in the view backend. But route event subscribers can later alter this value. If you create a view under /admin you can leave this option unchecked because we already have a route alteration as a route event subscriber (
\Drupal\system\EventSubscriber\AdminRouteSubscriber::alterRoutes()) that resolves all /admin routes. If no route subscribe alters the route, then this value will act.Nothing.
\Drupal\system\EventSubscriber\AdminRouteSubscriber::alterRoutes()is overriding your decision.Comment #17
claudiu.cristeaComment #18
dawehner@claudiu.cristea
Well, now its also a bit confusing, because the user might think that they can disable the admin theme via the UI, but well, they can't
Comment #19
claudiu.cristea@dawehner, right but happens everywhere in Drupal. You store a node title and then an hook_node_view changes that and shows the user other title. Nothing new here.
Comment #20
dawehnerRight, but this time we expose this behaviour even within just core.
Comment #21
claudiu.cristea@Bojhan,
@dawehner and me have discussed, here at Milan Drupal DevDays, to provide in this patch only the option without the UI part. In this way, it's still possible to achieve the goal by setting the config value. For the UI/UX part we need to understand what the user expects to find as a default value. Let's do that in a follow-up after this gets committed and, course, we need your input. In the current patch, the admin-theme option can have 3 states: NULL, TRUE, FALSE. If an explicit boolean is stored, that will override the default behaviour. If it's NULL is falling back to what we have now (eg. by /admin path prefix).
Comment #22
dawehnerShould we respect value potentially set already by something else?
Comment #23
claudiu.cristeaGood catch.
Comment #24
claudiu.cristeaComment #26
kristiaanvandeneyndeI'd like to see a feature like this go in. Not sure why there are two issues for it, though. I mean, I get that you want the option in and then build a UI for it in a follow-up, but the whole package shouldn't be that hard to get right in one go.
The way I see it, there are only four scenarios. Well two, really, but each has an on and off state:
So the main thing we need to fix is the notion that an 'off' checkbox for an altered route would somehow disable the admin theme, which it won't. There are a few ways to go about this.
1. Turn the checkbox into a radio element with a clear description.
The label being "Admin theme behavior" and the options being "Inherit" and "Enforced". The description could state:
Choosing "Enforced" would add the text between parentheses as shown in the screenshot in the other issue.
2. Actually make the checkbox trump all other route alterations
Using a route subscriber with a heavy weight, we could make the checkbox the ultimate admin theme defining mechanism. This would "break" core and other modules' views unless we write an update hook that figures out whether or not the admin theme is enabled for every individual view. And then there's still the issue of "default" views shipped by modules (config/install and config/optional) needing to be updated in their YAML files.
My preference goes to option 1 as it's more of a 'soft' flag. Introducing a 'hard' flag (option 2) could be done in D9.
P. S.: Loving the screenshots in the follow-up.
Comment #28
weekbeforenextThe last patch, new_option_for_views-2719797-1.patch, isn't working for 8.3.4. I tried re-rolling it, but it still doesn't seem to be working. Is there any chance someone can provide an updated patch for 8.3.4?
Thanks,
April
Comment #29
weekbeforenextThis solution helped me: https://www.computerminds.co.uk/drupal-code/drupal-8-views-how-set-admin....
Comment #30
kristiaanvandeneyndeI've given this some thought and I feel we should not introduce the three_way data type for this patch. It's currently serving as a placeholder because we're not including a UI in this issue yet. Once you add a UI option, how will you distinguish between NULL and FALSE with a checkbox? You'd need radio buttons where one maps to NULL, which I'd like to avoid.
So why don't we do the following:
The checkbox does not have to mean "do not show in the admin theme" when left unchecked. Instead, we could phrase it so the option becomes: "Default behavior" vs "Enforce admin path".
Comment #32
fagoAs a site-builder I'd expect this option to exist - it being missing is quite unfortunate.
I agree that the usability issue of /admin being always admin routes can be solved by simply phrasing the checkbox like the following:
"Enforce this path to be displayed in the admin theme"
Description: Note that paths starting with /admin/ are always shown in the admin theme.
This should explain everything and even document the so-far undocumented behavior, this it's even an UX improvement! ;)
Comment #33
fagoI re-rolled the patch from #16 and improved the labelling as suggested. The patch applies to 8.3.x and 8.4.x as well.
Comment #35
lendude@fago++ I really like where this is going!
\Drupal\views\Plugin\views\display\Page::getRoutegot added in #2449143: REST views specify HTML as a possible request format, so if there is a "regular" HTML view on the same path, it will serve JSON, so this fatals when applied.Also, can we update this to extend
\Drupal\FunctionalTests\Update\UpdatePathTestBaseplease (and move it to the right dir)Comment #36
claudiu.cristeaGlad this is back.
Fixed the method duplication. The
::testAdminTheme()is new, so it should not contain deprecated code. Move the update test.Comment #37
claudiu.cristeaA 8.4.x version of #36 for those who need it.
Comment #38
dawehnerCan we rename the key as well, so it clear setting it to false might cause it to in the admin theme as well?
Comment #39
claudiu.cristeayes, makes sense.
enforce_admin_theme?Comment #40
claudiu.cristeaFixed the key.
Comment #41
lendudeReally nice feature, and RTBC now in my book.
Comment #42
claudiu.cristeaThis deserves a change notice and probably should go in release notes as a new feature. Here's the CR https://www.drupal.org/node/2917575
Comment #43
kristiaanvandeneyndeGreat patch, loving it!
Minor nitpick:
That should read FALSE instead of TRUE, as indicated by the actual update hook.
Comment #44
claudiu.cristeaOh, yes. In fact only the comment is wrong. Thank you for catching.
Comment #45
kristiaanvandeneyndeNo worries, thank you for working on it :)
Comment #47
claudiu.cristeaUnrelated failure.
Comment #48
dawehnerCan we ensure to not save the view multiple times when there are multiple page displays?
Comment #49
xjmThis is a cool idea for a feature! Looks like it has signoff from a(nother) Views maintainer already.
Here's what this looks like in the user interface (edit -- having some issues with file attachments; I'll try again shortly...)
I think "enforce admin theme" has undesirable connotations. A better choice might be "Always use admin theme".
In our UI text standard, "Using" should be capitalized here.
This is a lot of words for the checkbox value. I think we could just change this title to "Always use admin theme" for better readability.
I would reduce this text to "Paths starting with /admin/ use the admin theme even when this is not set."
Comment #50
xjmComment #51
claudiu.cristeaComment #52
claudiu.cristeaImplemented #48, #49. The usability review was done already in #15 but let's see a new review based on the last changes.
Change notice adapted.
Comment #53
claudiu.cristeaUpdated IS to reflect latest changes.
Comment #54
claudiu.cristea@Lendude, could you, please, review again? Thank you.
Comment #55
lendude@claudiu.cristea sure!
All feedback from #48/#49 has been addressed. From a code standpoint this is RTBC again.
But I agree we need the usability review for the current proposed changed before moving forward. So leaving at 'needs review' for that.
Comment #56
pfrenssenI did a usability review wearing my site builder hat.
Comment #57
kristiaanvandeneyndeFair points Pieter, thanks for the review.
Re .3: The checkbox used to say "Enforce this page to be displayed in the admin theme", but that was changed to the current label following #49.3. A final version that everyone can agree upon would be nice :)
Comment #58
claudiu.cristeaThank you, @pfrenssen, for review.
As the code has been reviewed in #55, let's discuss #56.3, 4 and 5:
So, we are at "Always use admin theme" as result of a process. Anyway, as the description gives details, I think we can keep it as it is.
Now as we already have the RTBC for the technical solution and code in #55 and because we have already the usability review made two times, I'm switching this to RTBC (as per #55).
Comment #59
claudiu.cristeaSorry, forgot the patch :)
Comment #60
xjmThanks everyone. The usability review in #15 wasn't based on the latest version of the patch. Since @pfrenssen had other suggestions about the strings, let's get another usability review now.
The other screenshots were kind of small, so I added these:
Comment #61
benjifisherWe reviewed this on the weekly UX meeting.
We had several questions. As usual, we did not have time to review all the comments, so some of these may already have been discussed.
Discoverability
If a site administrator does not know where to look for it, then this checkbox is hard to find. Often, the administrator sets the path when first creating the view. Then there is no reason to edit it later, exposing this option.
It would be easier to find this option if it were added as one of the Page settings: Path, Menu, Access, and ... Admin? Clicking on the new option would bring up a page or modal with a more complete explanation.
Other effects
The path works by setting the
_admin_routeoption on the route. This is checked byAdminContext::isAdminRoute(), which has effects other than setting the theme. For example,quickedit_page_attachments()will not enable in-place editing for an admin page.So, is this issue about creating "admin pages" or is it about using the admin theme? If it is about "admin pages", then we need to be clearer about the effect of selecting the option. If it is about using a different theme, then why not present a choice of all enabled themes (as well as "site default" and "admin theme")? Either way, you can make good use of the extra space you get by making this a separate option under Page settings.
Comment #62
yoroy commentedSomething like this:
Comment #64
xjmComment #65
claudiu.cristeaSimple reroll of #59 for 8.5.x.
#61 and #62 still not addressed.
Comment #66
daniel korteReroll
Comment #69
claudiu.cristeaI've implemented the usability team review recommendations from #62.
Others:
Comment #70
jidrone commentedHi everyone,
I don't know if I am the only one with the following error when running db updates:
[error] Placeholders must have a trailing [] if they are to be expanded with an array of values.
[error] Update failed: views_post_update_enforce_admin_theme
Comment #71
grayle commentedPatch no longer applies to 8.6.4. Assuming that means it also won't apply to 8.7 anymore either.
Comment #72
grayle commentedNope, it does still apply. Just some composer weirdness. Nvm.
Also, we've been using it since September and everything works fine.
Comment #73
alexpottThis should use the config entity updater. Does it it need to set the value or can it just do a save and the default value (hopefully FALSE) be completed?
Also manual testing shows me that I'm not sure that the update path is necessary. If I:
always_use_admin_themesetting is not set.It is only set if I invoke the dialogue to make the change. Therefore I think we can skip the update path and rely on the default value. This is also true for new views created via the wizard.
Also we already have a place in core where we can switch between admin and other themes so I think we should use that as inspiration. See the /admin/appearance page - all the way at the bottom:

I think we need to have a checkbox that says "Use administration theme" we also need to add similar text that this will impact who can see the view due to the permission to use the admin theme. Also if the path is set to something like
admin/blahthis option should be disabled and checked because it will be using the admin theme.Also the summary label of

Admin page: nomakes no sense when the page is admin/content because this is clearly an admin page. See screenshot:I think this page needs a bit more UI work to make it consistent. Also if we do this I think the setting should be
use_admin_themeComment #74
kristiaanvandeneyndeIf you're simply updating the config,which seems to be the case, I'd say a hook_update_N is in order. If you want to actually use the entity API to save the views, then it should be a post-update hook that saves the entities, like Alex said.
If this is intended, then yeah: You can skip the update path altogether.
On a sidenote: Wouldn't it be cleaner for the key to always be present in the config export, though? Or is that already the case? From your comment above, it seems to be missing when set to FALSE as the default (i.e. UI was not saved).
Comment #76
esolitosPatch rerolled for 8.8.x.
As suggested on #73 I updated the patch to
- use the config name
use_admin_themeinstead ofalways_use_admin_theme,- improved (I hope) some texts to be more consistent with pre-existing options in Drupal
- mark the summary label to "Yes (Forced)" when the display path starts with
/admin/...Comment #77
esolitosHerg, uploaded a patch with a typo, ignore patch from #76!
Comment #78
fenstrat#77 is good to go and addresses the feedback from #73. Have manually tested it, and agree that there's no need for an upgrade path.
Comment #80
aiphesSuscribe to this option, because actually I can't set admin theme for a Views Page (Manage Content page display) for users, the original page is served with admin theme...
Comment #83
esolitosComment #84
martijn de witWhy are you changing the status, if the test failed on the patch.
I think no maintainer wil commit it, if he/she sees a failed test without any explanation.
Comment #85
jungleAgree with #84
Comment #86
aleevasFixed failed test and re-rolled onto 9.1 branch
Comment #87
jungleThanks @aleevas!
Should we add a global option to
views.settings.yml(/admin/structure/views/settingsaccordingly) for the'admin/'thing?, for example:Furthermore, what if users want an alternative path to be forced. Such as
administration/,guan-li-yuan/(Guan li yuan in Chinese pinyin means admin), ordrupal/admin/So, two config keys might be considered, for example:
Moreover:
The last, should a hook or event be considered to allow contributed module(s) altering the default
start withlogic of matching the display path. e.g. what if they want the matching logic becontains string foobaretc.Comment #88
lendudeThanks everybody for working on this!
#87.1 the forced use for the admin theme on a /admin path doesn't come from Views, so we shouldn't add an option to Views to do that. Even if we want to do that, I'd say this is out of scope for this issue. Same goes for the second option, nice idea, but out of scope here, we can look at that in a follow up.
#87.2 Good idea, lets disable the checkbox on forced paths
#87.3 Also out of scope, we can look at that in a follow up
This comment doesn't really add much value, do we need this? Seems pretty obvious that you only set this option when the right setting was set in the View
"the views' dispaly" can just be "the display".
I don't think these need to be two sentences, but one.
For all inline comments (even multi line) we use // not /* */
0 === striposis a yoda statement, we try to avoid those for readabilityThis logic needs test coverage
Comment #89
saurabh-2k17 commentedComment #90
saurabh-2k17 commentedHi @Lendude,
I have tried fixing your points.
Thanks
Comment #91
jungleThanks, @Lendude! agreed with your reply to #87.
Thanks @Saurabh_sgh! No exceed 80 chars, great! But wrapped too early, and unexpected tail whitespaces.
#87.2 has not been addressed yet.
Comment #92
pavnish commentedComment #93
pavnish commentedComment #94
saurabh-2k17 commentedComment #95
saurabh-2k17 commentedHi @jungle,
I have addressed all your points in this patch.
Thanks
Comment #96
jungleThank you, @Saurabh_sgh!
Should be adjusted further. "rendered with" wrapped too early as well.
Meanwhile, it should be auto-checked if the display path starts with
admin/Needs updating the test to cover the new change.
Comment #97
saurabh-2k17 commentedComment #98
saurabh-2k17 commentedHi @jungle
I have addressed your point except 96.3, I don't think there is change required in that part. If you still feel change is required, please guide me so that i could change it as per your suggestions.
Thanks
Comment #99
jungleThanks, @Saurabh_sgh! Perhaps, the official doc might help, see PHPUnit in Drupal.
Comment #100
lendudeWe shouldn't be updating this comment, since it is unrelated to the patch.
And the change we are referring to, is that we need to update the test coverage to cover this if/else piece of logic
Comment #101
jungleThanks @Lendude, +1 to #100.1, did not realize it.
Comment #102
saurabh-2k17 commentedComment #103
saurabh-2k17 commentedComment #104
Ruchi Joshi commented@saurabh-2k17 : Patch#98 is failing on applying it for drupal 9.1. Needs re-roll of the patch.
Comment #105
Ruchi Joshi commentedMoving it to "Needs Work" for patch reroll
Comment #106
snehalgaikwad commentedRe-rolled the patch and as per #100.1 kept comment as it was before.
Comment #107
Ruchi Joshi commentedPatch#106 is not working on drupal 9 as per expectation:
1. Check box should be labelled as "Always use admin theme"
2. Helper text for check box should be "Paths starting with "admin/" use the admin theme even this option is not checked"
3. On checking the box "Use the administration theme", Default theme is not appearing on the page.
Screenshots are attached.
Steps:
1. Visit /admin/structure/views
2. Open view page of any content
3. Click on "Admin page | No" under Page Settings.
4. A dialog box will appear with a checkbox
5. Click on checkbox and then on apply
Comment #108
Ruchi Joshi commentedMoving it to "Needs work" for fixing of issues on comment #107
Comment #109
rajneeshb commentedUpdated the patch as per #107
Comment #110
Ruchi Joshi commentedTested patch #109 for the issues mentioned in comment #107. All the issues are covered in this updated patch and working fine. @claudiu.cristea- +1 for RTBC.
Screenshots are attached.
Comment #112
tanubansal commented#109 working for me as well
RTBC + 1
Comment #113
sulfikar_s commentedI've tested the patch in #109. It applied cleanly but I found it would be more meaningful when we change the text "even this option is not checked" in,
to "even when this option is not checked" as said in #56. i.e,
Also, there are some coding standard issues,
So, I've corrected all of this in my patch. Hereby attaching the patch and interdiff.
Please review. Thanks!
Comment #114
jonathanshawI think we should be cautious about disabling this option on paths that start with /admin. Yes these use the admin theme by default, but modules and sites could customise that behavior.
I'd suggest simply having the description saying something like "By default paths beginning with /admin/ will use the admin theme without regard to this setting.".
Comment #115
le72I did try #113 and it is OK.
RTBC + 1
Comment #116
bserem commentedRTBC+1 here too. We have it under testing for about a week, we will be deploying to production very very soon.
Comment #117
akalam commentedThe patch #113 applies and works as expected on a Drupal 9.0.11 site. Great improvement. +1 to RTBC
Comment #118
bserem commentedComment #119
catchThe patch no longer applies.
This seems potentially useful, but some of the wording could use some help IMO, tagging for usability review.
Can we use something like 'Yes (admin path)' or something instead of 'forced by path'? Definitely adds some complexity having to deal with both cases.
Comment #120
ayushmishra206 commentedRerolled for 9.2.x and made the suggested change in #120. Please review.
Comment #121
keopxPatch #120 works for me (9.1.5)
Thanks!!
Comment #123
benjifisherUsability Review
We discussed this issue at #3210553: Drupal Usability Meeting 2021-04-30.
@keopx, an issue should be marked "Reviewed & tested by the community" (RTBC) only when it has been both reviewed and tested. From your comment, it seems that you tested, but you did not say anything about review. In fact, the patch in #120 did not pass automated tests, so we have to set the status back to "Needs work" (NW).
The message "Custom Commands Failed" usually means that there are problems found in static analysis: spelling errors, coding standards problems, etc. Look at the test results for a full report.
The modal window has the message
That should be "… even when this option is not checked." The screenshot in the issue summary shows the correct text.
The consensus at the usability meeting was that "Admin page" is misleading. It suggests access restrictions as well as a theme. (As I said in #61, there are some effects other than changing the theme, but access restriction is not one of them.) I have browsed the comments (not read all of them) and I am not sure when the text changes from "Always use admin theme" (as in #49, for example) to "Admin page". Was there a full discussion? I do see discussion in #56-#58, settling on "Always use admin theme".
If a user does not have permission to use the admin theme, then the page will be shown in the site’s default theme. Perhaps the description in the modal window should mention this.
Comment #124
benjifisherThe change to 10.0.x was a gllitch. Back to 9.3.x. See #3211455: Bulk updates for the 9.2.x release cycle.
Comment #125
swentel commentedNew patch with subtle changes:
I don't have any other strong opinions, so if someone decides on the working, let's go ahead :)
Comment #126
swentel commentedFix errors
Comment #127
mitthukumawat commentedI have applied and tested the patch #126. it is showing the following changes done as per #125.
Adding screenshots for reference.
Comment #128
camslice commentedNice work folks. Patch #126 working well for me.
Comment #129
heni_deepak commentedThis is such a useful and great patch #126. I have applied at my job it is really useful I think I was waiting for it.
Comment #130
z.stolar commentedFWIW, the patch at #126 is working as expected and does a great service.
Marking as RTBC to help push this issue forward.
Comment #133
jeroentTests are failing because of #3255749: Composer v2.2 prompts to authorize plugins
Comment #135
claudiu.cristeaSame as #133
Comment #136
alexpottWe need to do a little bit of work to not save the setting if the views path starts with
admin/Currently if I do this:
I'll see that the view has been updated to set
use_admin_theme: falsewhich is odd because it will use the admin theme. I think it shouldn't be saving the setting in this case.Also if do this:
I'll see a new
use_admin_theme: falseeven though I've not really changed anything.This brings into question whether we need an update path to add this to all views which leverage a page display. I think it might be best to not set this configuration when it is FALSE. it's not as if we're ever going to change the default behaviour. Not sure.
Comment #137
pfrenssenRebased against 9.4.x and opened MR.
Uploading a patch against 9.3.x. The patch from #126 still applies to 9.2.x.
Comment #140
cedeweyI tested this patch and it worked for me in Drupal 9.2.12
Comment #141
heni_deepak commentedneed to be update with drupal dev version
->set('admin', 'seven')Drupal >= 9.4 admin theme is Claro
Comment #142
gayatri chahar commentedI have successfully applied patch #137 on drupal 9.2.22-dev and its working for me
Thanks @pfrenssen. Adding screenshots for the refrence
Comment #143
smustgrave commentedMoving to NW for
Can we get a tests-only patch with the full path also please to verify the tests work.
#141 needs to be addressed
And Bug found in last bullet of testing.
Manually tested
No more screenshots are needed.
Comment #144
smustgrave commentedUpdated for #141.
Uploaded tests only patch
The bug mentioned above "BUG: The URL of the page is now just /admin vs /admin/test" may not actually be an issue it seems.
Comment #146
heni_deepak commentedlooks like working for me. :D
Comment #147
heni_deepak commentedI have added a Test page view
The admin theme working on both URL
admin/test and test
can restrict if don't change URL with admin/?
Comment #148
heni_deepak commentedComment #149
adam_y commentedhttps://www.drupal.org/files/issues/2022-09-20/2719797-144.patch - works for me.
Comment #150
alexpott#136 is still not addressed.
Comment #152
scotwith1t#144 no longer applies to Drupal 9.4.8, needs a re-roll
Comment #153
nitin shrivastava commentedCreated patch for 9.4.x by considering the comment of #152. Please review this patch and move it
Comment #154
anchal_gupta commentedFixed CS error.
Comment #155
Ratan Priya commentedFixed failed custom command for comment #154.
Comment #157
smustgrave commentedRemoving credit for #153, #154, #155.
Patch #144 still applies cleanly to 9.5.x and 10.1.x so the follow up was not needed.
Will look into #136
Comment #158
smustgrave commented@alexpott regarding #136 this something like you meant?
Comment #159
gaurav-mathur commentedApplied patch #158 on drupal version 10.1.x-dev successfully and working fine.
Refer to screenshot.
Thank you
Comment #160
hitchshockGreat patch to avoid custom hacking, now we can easily apply admin theme.
+1 RTBC
Comment #161
mlncn commentedWorks beautifully and addresses concern in #136 of unneeded noise in config files while still keeping code pretty straightforward.
Comment #162
quietone commented@mlncn, thanks for checking that #136 is addressed (I have not confirmed that) but this is tagged for a usability review which means this is not ready for RTBC.
I found the latest review was done in May 2021 (#123). Have all those points been addressed? The screenshots in the Issue Summary are from 2018, so they need to be updated.
In #153, this was changed from a Feature Request to a Bug without explanation. I do not see any reference to this change in earlier comments. I am restoring the category of Feature Request.
Comment #163
quietone commentedThe change records also has out of date screenshots. I did not read the text of the change record.
Comment #164
smustgrave commentedUpdated screenshots here and on CR.
Comment #165
rtdean93 commented2719797-158.patch worked perfectly for me on 9.4.8. Thanks.
Comment #166
nicolas bouteille commentedSame for me thanks!
Comment #167
smustgrave commentedPutting back to RTBC from #161 as there was no code change.
Comment #169
arunkumarkTested the patch manually with Drupal core 10.1.x. The patch was applied cleanly and was able to use the option of the Admin theme. Attached screenshot for reference.
Moving the status to RTBC.
Comment #170
lauriiiThis has received multiple iterations of Usability review. All of the feedback has been addressed except explaining what other consequences there are from marking a page as admin page. The example provided there was Quickedit, which has been removed from core. I believe this might be outdated and therefore I'm not opening a follow-up issue for this.
Since this is no longer a required property, it should be marked as nullable.
Super nit: s/"/'
We should use the term "administration theme" consistently across all of these strings instead of "admin theme"
We are missing the before admin theme.
Comment #171
lauriiiAddressed my feedback and added some more test coverage for the UI.
Comment #172
smustgrave commentedNew changes look good.
I ran the new test locally too to make sure it failed
Behat\Mink\Exception\ResponseTextException : The text "Administration theme: No" was not found anywhere in the text of the current page.
Excited for this new feature.
Comment #173
alexpottThe use of "Always" here was question by @pfrenssen in #56 and sent back for usability review but the UX review in #61 did not actually address this - it made other recommendations. I think the "always" perhaps was more relevant when this was in the path setting dialog.
Furthermore the description is odd because it says
Paths starting with "admin/" use the administration theme even when this option is not checkedbut we have code below disabling and setting the field to TRUE when the path starts with admin so it will never be not set.I think we should change this code element to:
Comment #174
rishabh vishwakarma commentedUpdated as described in #173
Comment #175
smustgrave commentedComment #176
akram khanadded updated patch fixed CCF #174
Comment #177
akram khanComment #178
smustgrave commented@catch think your points have been addressed.
Comment #179
jungleI think the path should be case-insensitive. eg,
admin/,Admin/orADMIN/etc. should use the administration theme automatically. Sostr_starts_withshould be replaced withstriposabove. And we need to add a test for this.NR for agreement.
Comment #180
dwwSo excited this is so close to being done! Thanks to everyone who has moved it forward.
Alas #176 introduced a ton of irrelevant whitespace changes, and undesirable capitalization changes. Un-saving "credit" for the anti-contribution.
And #174 did some things to #171 that were not requested in #173 (like removing the
#titleof the form itself).I think we need to go back to the patch in #171, and carefully re-address #173 only.
I'm a bit torn on #179, but yeah, we should probably fix that, too. 😅
Comment #181
dwwHere's exactly #171 with only the suggested changes in #173. I'm leaving #179 out of it for now.
Comment #182
lauriiiI think
str_starts_withis better because it's consistent with\Drupal\system\EventSubscriber\AdminRouteSubscriber::alterRoutes. Can we change this too to usestr_starts_with?Comment #183
dwwOkay, thanks for clarifying. I was about to post test-only and full to address #179 but d.o flagged it as a x-post that you had already changed the status. 😅 I'll remove the remaining stripos().
Comment #184
dwwFixes #182 (and the
??improvement suggested for a similar code block in #173) and nowcore/scripts/dev/commit-code-check.sh --cachedis passing. 😅Comment #185
dww(Side note: Did something with d.o CI change in the last 3 days, or does the bot not run the same checks for core committer patches as it does for the rest of us? 😂 @lauriii's patch in #171 has all the same CS bugs as #181, but the testbot flagged mine and wouldn't even test it, but ran the whole test suite for 171... weird)
Comment #186
dwwJust noticed a possible minor nit:
The code here is totally hard-coded. Do we want to let translators potentially change this? In some other UI strings, I've seen placeholders used to ensure that the path output is always what core wants. Do we care?
Oh, and more uber-nit, doesn't this want
: void?That's not what the UI label is, anymore... 😅
I'll clean up 2 and 3 while waiting for feedback on 1.
Comment #187
dwwFixes #186 points 2 and 3 for now. Maybe point 1 isn't real.
Comment #188
dwwArgh, sorry for the noise! I spotted one more "Always" we don't want.
Comment #189
lauriii@dww IMO providing a placeholder for the "admin/" part would be great! 👍
Comment #190
dwwCool, then this fixes #186.1. Anything else? Thanks! 🙏
Comment #191
lauriiiLooks great! Thank you @dww!
Comment #192
dwwGreat, thanks! Fixed the summary and screenshots to reflect the current patch.
However, I noticed the draft CR is stale, with stale screenshots, "Always", etc. But it's almost 1am here now, so I'm just going to add the tag and hope someone else can handle that. ;)
Thanks again, excited to see this almost in core! 🎉🙏
-Derek
Comment #193
dwwHiding obsolete files and updating remaining tasks.
Comment #194
alexpottCommitted 4dbf3f4 and pushed to 10.1.x. Thanks!
Hopefully got the issue credit correct. I credited everyone who provided screenshots of the feature because it was hard to decide whose screenshots where useful and whose where not.
Comment #196
longwaveComment #197
z.stolar commentedSing Halleluyah!!!!
Comment #198
quietone commentedThis is tagged for change record improvements. I have updated the CR and setting to NR for someone to check that changes.
Comment #199
lauriiiThe updated change record looks good! I removed the paragraph about the location of the config since that didn't seem critical to most users.
Comment #201
saurabh-2k17 commentedI am attaching a working patch for this issue.