Problem/Motivation
Editor AJAX routes don't determine the proper admin theme when making a request. This results in the request loading the default theme's libraries (and alters to those libraries). This can cause issues when the default theme's assets aren't actually loaded.
Proposed resolution
Add the necessary ajax_base_page
theme negotiator option to editor.routing.yml
.
Remaining tasks
Create patch- Create tests? - Unclear if this is needed
User interface changes
None
API changes
None
Data model changes
None
Original Post
This happens since https://www.drupal.org/node/2637888
Steps to reproduce:
- Install Drupal with profile standard
- Set bootstrap theme as installed and default
- add an article node
- Try to use the link button for the body in the wysiwyg
The modal doesn't show up and you get an error on the js console:
Drupal.theme.bootstrapModal is not a function
Comment | File | Size | Author |
---|---|---|---|
#3 | editor_routes_don_t_use-2640086-3.patch | 1.28 KB | markhalliwell |
Comments
Comment #2
markhalliwellThis is a core bug, will attach a patch shortly.
Comment #3
markhalliwellComment #4
rodrigoaguileraI did a manual test and I get the seven theme modal instead of the bootstrap error.
I have no clue on how this can be tested without something like behat.
Comment #5
markhalliwellIt may not need tests. Not sure why you set to CNW, especially since you have confirmed the patch works, but setting it back to CNR so others can take a look.
Comment #6
markhalliwellThe Bootstrap IQ has already received 3 issues on this (including this one that was moved, see referenced by issues). While this isn't necessarily "critical" (e.g. no data loss), it's extremely annoying and the above patch is not an obvious fix to the symptom it causes.
Does this really need tests? What needs to happen for this issue to move forward?
Comment #7
markhalliwellAnother issue.
Comment #8
markhalliwellComment #9
jonodunnett CreditAttribution: jonodunnett as a volunteer commentedPatch in #3 fixes the issue for me :) thank you.
Comment #10
dawehnerIn order to test this properly as a functional test we would require javascript testing, which doesn't exist at this point in time.
Comment #11
Wim LeersLGTM
Comment #12
catchThis could probably be tested by faking the AJAX request then confirming that theme negotiation happens, however it's not going to be a meaningful test of the editor AJAX functionality, and we should already have testing that the route option works, so not worth it in either case.
Would be a good one to add a BrowserTestBase test for once that's available though.
Committed/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!