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.
Problem/Motivation
For #3227033: Remove Quick Edit from core we need to remove all references to quickedit from core. Quickedit provides the permission "access in-place editing". Outside of quickedit this is used in the editor module in editor.routing.yml
editor.field_untransformed_text:
path: '/editor/{entity_type}/{entity}/{field_name}/{langcode}/{view_mode_id}'
defaults:
_controller: '\Drupal\editor\EditorController::getUntransformedText'
options:
parameters:
entity:
type: entity:{entity_type}
requirements:
_permission: 'access in-place editing'
_access_quickedit_entity_field: 'TRUE'
Steps to reproduce
Proposed resolution
Move this to quickedit in 9.5.x and remove in 10.0.x
Remaining tasks
- Determine what this route does
- Move it, deprecate it, or refactor if appropriate
User interface changes
API changes
The route editor.field_untransformed_text is deprecated and moved to quickedit
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|
Issue fork drupal-3267258
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
dwwGood find, thanks for opening this. More tentacles! 😉
Comment #3
quietone CreditAttribution: quietone at PreviousNext commentedChanging parent to the main tracking issue. Might get some more exposure as well.
Comment #4
Wim LeersDrupal.quickedit.editors.editor._getUntransformedText()
uses this:The solution is simple IMHO:
\Drupal\editor\Plugin\InPlaceEditor\Editor
(and its route + its JS) out ofcore/modules/editor
and intocore/modules/quickedit
editor
module is installedComment #5
dww@Wim Leers: Thanks! Very helpful. Here's an untested first attempt. Let's see how badly this blows up the bot. 😅
Comment #6
dwwMeanwhile, how does one deprecate a route?
Comment #7
dwwsh ./core/scripts/dev/commit-code-check.sh
is hanging on my local dev box, sorry about that. This should now at least get past the code check phase...Comment #8
mstrelan CreditAttribution: mstrelan commentedI believe there is support for this in newer versions of Symfony. Best I can come up with is to deprecate the class and leave the route in tact. I guess the old route could move to quickedit too 🤔
Comment #10
SpokjeComment #11
catchWe can't yet, see #3159210: Support route aliasing (Symfony 5.4) and allow deprecating the route name. But in this case we don't need to - we don't consider route names part of the API (even though we might not randomly move ones that are referenced a lot).
Comment #12
Wim Leers🤓 Note that you could even keep the URL the same, for less disruption — specifically when the JS is still cached on the client, it'll continue to make requests against the old URL.
So keeping the old URL would reduce disruption.
🤓 This is the only use in Drupal core of
GetUntransformedTextCommand
. If we move the Quick Edit module to contrib, I think we should A) deprecate the PHP class in core, B) switch the Quick Edit module to use its own copy of this command.Comment #13
SpokjeThis is not going to be a big success, but for now I don't have any more time left.
Let's see if we can bring the number of failures down.
Haven't done _anything with #11 and #12
Comment #14
SpokjeMo' sleep, mo' green?
Comment #15
SpokjeSince the patch in #14 removes skipping of test in
core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php
it might fail because of the NewChromeDriverMageddon.I've got a pretty decent, if I say so myself, fix up for review over in #3268010: Restore/Robustify \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditIntegrationTest::testCustomBlock(), so folks might want to head over there for some reviewing.
Comment #16
SpokjeSo #14 was indeed hit by Chromageddon.
Still putting it on NR for eyes on it and #3268010: Restore/Robustify \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditIntegrationTest::testCustomBlock().
We have to also look at #12.
1. I don't have enough knowledge to have a solid opinion on _not_ removing the old route, but it feels a bit dirty to me.
At some point it _will_ become disruptive, when D10 lands without quickedit. I rather have stuff "breaking" as soon as possible, to create awareness that quickedit is leaving Core and because brains here are still filled with the knowledge about changes we made.
2. I like it and it makes sense to deprecate the current class and create a new one in (contrib) quickedit.
The class doesn't seem to be "heavily" used in Contrib anyway: http://grep.xnddx.ru/search?text=GetUntransformedTextCommand&filename=
My question is: Should it be done here or in (Yet Another) follow-up issue.
Comment #17
mstrelan CreditAttribution: mstrelan commentedI think it's fine to do in this issue, that's what I've done in #3265140: Move QuickEditImageController from image to quickedit.
Comment #18
catchI think whatever's easiest to manage is fine - the only thing that complicates it is 10.x removal and 9.4.x deprecation, otherwise it's straightforward.
Comment #19
SpokjeThanks @mstrelan and @catch, let's do #12.2 here and make 2 patches, one for
9.4.x-dev
and10.0.x-dev
.Comment #20
SpokjeAdded draft CR.
Unsure if Release note is needed?
Comment #21
SpokjeComment #22
SpokjeComment #23
SpokjeComment #24
SpokjeBesides #3268010: Restore/Robustify \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditIntegrationTest::testCustomBlock() this seems ready for review again.
Comment #25
SpokjeComment #27
SpokjeUsed 3267258-d94-25.patch as base for the MR for
9.4.x-dev
.Comment #29
SpokjeUsed 3267258-d10-23.patch as base for the new
10.0.x-dev
MR.Comment #31
xjmThat looks like a real fail of that test, not a random.
Comment #33
SpokjeComment #34
SpokjeComment #35
SpokjeComment #36
Wim LeersThis looks very close! 👍
Comment #38
andregp CreditAttribution: andregp at CI&T commentedAddressed @Wim Leers comments.
Comment #39
SpokjeWe've identified (and fixed) the root cause of random failures in
\Drupal\Tests\quickedit\FunctionalJavascript\QuickEditIntegrationTest::testCustomBlock()
, but haven't looked at::testArticleNode()
yet.Let's see if there's a fix for that one, we have some QuickEdit test failure trickery in our bag by now, maybe one of those can help.
Comment #40
SpokjeComment #41
SpokjeComment #42
Wim LeersThis needs #3268244: [random test failure] Un-skip and fix QuickEditIntegrationTest::testArticleNode() to land first (it currently incorporates that change directly into the MR — but #3268244 should just land first, that'll simplify this MR!).
Comment #43
catch#3268244: [random test failure] Un-skip and fix QuickEditIntegrationTest::testArticleNode() is in.
Comment #44
Wim Leers#3268244: [random test failure] Un-skip and fix QuickEditIntegrationTest::testArticleNode() landed, let's do this!
EDIT: dammit, @catch beat me to it 🤣
Comment #45
SpokjeComment #46
Wim LeersOnly a single question left! 😄
Comment #47
SpokjeLast question resolved, 2x green TestBot.
Comment #48
SpokjeComment #49
dwwPer #3268244-49: [random test failure] Un-skip and fix QuickEditIntegrationTest::testArticleNode(), that fix was never pushed to 9.5.x. We need that commit pushed, then to rebase this MR, so the MR isn't duplicating the effort from 3268244.
Comment #50
dwwNope, I misread. It should be there. I think this MR just needs a real rebase.
Comment #51
SpokjeNothing to "proper rebase" here IMHO. The threads you opened were never part of #3268244: [random test failure] Un-skip and fix QuickEditIntegrationTest::testArticleNode().
That one is about
::testArticleNode()
, the changes you marked are for::testCustomBlock()
.Comment #52
dwwYeah, sorry. I've been deep in so many other swamps the last few weeks, I'm struggling to get my head back into the QE quagmire. 😉 I think this is fine. I don't really have anything else to complain about. If it works, ship it!
Comment #53
catchI think it's OK to unskip the test here - there's lots of other test changes, we won't have the test in 10.0.x once this is in. Absolute worst case we'd have to start skipping it again in 9.5.x.
Committed/pushed the respective MR diffs to 10.0.x and 9.5.x, thanks!
Comment #57
SpokjePublished CR.
Comment #58
Wim LeersYep, agreed that fixing/unskipping the test as part of this issue was fine.
Was hoping to RTBC this morning, but instead I got the notification that it was in already: better still! 👏
Thanks for all the epic work on this and related issues!
Comment #59
SpokjeWell, the module is named
Quick
Edit...Me and my buddy Sisyphus are here all week. Try the veal!
Comment #60
Wim Leers🤣
Comment #61
SpokjeComment #62
SpokjeThe attached plain diff from MR2020 applies cleanly to
9.4.x-dev
.Comment #63
SpokjeFollow-up to change the deprecation errors mentioning
9.5.0
to9.4.2
here: #3292525: [PP-1] Update deprecation errors made in [#3267258] from 9.5.0 to 9.4.2Comment #64
SpokjeWe also need to update the CR when this gets committed.
Comment #65
SpokjeNot backporting this any more.