#1938980: Fix Ajax system; the last remnants of the old API must be swept away started off so simple. We just want to move some classes around for clarity, and to make it easier to extend. In the process, though, we realized there were still unresolved bugs in the Ajax system, and fixing THOSE is taking considerably more time and has a long dependency chain. Sigh.
In an effort to get things moving, this contains JUST the code-moving-around parts. The ajax resolution code is still what's in core now, which doesn't handle new-style routes, just old-style routes. We know that, it's OK, we'll fix it in the other issue, but let's get in the parts we can.
Patch as soon as I have a nid.
Comment | File | Size | Author |
---|---|---|---|
#17 | route-enhancers-1963470.17.patch | 12.65 KB | larowlan |
#17 | route-enhancers-1963470.17.interdiff.txt | 3.41 KB | larowlan |
#14 | routes-1963470-14-with-uncommented-test.patch | 12.46 KB | tim.plunkett |
#14 | routes-1963470-14.patch | 12.48 KB | tim.plunkett |
#10 | interdiff_4_7.txt | 1.39 KB | effulgentsia |
Comments
Comment #1
Crell CreditAttribution: Crell commentedComment #2
Crell CreditAttribution: Crell commentedForgot that...
Comment #3
effulgentsia CreditAttribution: effulgentsia commented#1 no longer applies on HEAD.
Comment #4
Crell CreditAttribution: Crell commentedThe YAML service conversion killed it.
Comment #5
effulgentsia CreditAttribution: effulgentsia commentedAJAX on hook_menu() routes still fails on this, just as it did in #1938980-22: Fix Ajax system; the last remnants of the old API must be swept away. Here's a fix to our tests so that bot catches it. Will follow up here with a fix to the patch to make them pass.
Comment #6
effulgentsia CreditAttribution: effulgentsia commentedThis fixes the failures caused by this issue. However, there are still AJAX asset delivery failures that exist in HEAD, but not previously caught by bot due to its lack of sending the header added in #5. With that header added, that bug is now being caught by bot. The fix for it is being worked on in #1941288: Regression: ajaxPageState not being updated with AjaxResponse, assets (js/css) being added twice.
Comment #7
effulgentsia CreditAttribution: effulgentsia commentedThis just applies the code fixes in #6, but without the test fixes in #5, in case we want to not hold this issue up on #1941288: Regression: ajaxPageState not being updated with AjaxResponse, assets (js/css) being added twice.
Comment #8
Crell CreditAttribution: Crell commentedAlex: No no no. Please don't go down the "Fix ajax path" here. That's what's blocking the other issue. The whole point here is to NOT FIX THAT, because it's irrelevant to "just moving the damned code around". This issue is just moving code around. Please don't do anything else here.
Comment #9
effulgentsia CreditAttribution: effulgentsia commentedRouteProcessorSubscriber in HEAD runs on all requests. #4 replaces that with enhancers that run only on new router routes. Therefore, it breaks system/ajax requests by not running AjaxEnhancer on it. #7 fixes that (see the #6 interdiff).
Comment #10
effulgentsia CreditAttribution: effulgentsia commentedTo clarify, this is the interdiff from #4 to #7. All it does is change AjaxEnhancer to apply to legacy routes as well, to match the existing behavior in HEAD per #9.
The fails in #6 are the same as the fails in #1967036: WebTestBase::drupalGetAJAX() and WebTestBase::drupalPostAJAX() don't set the Accept header needed for content negotiation, and are a preexisting bug in HEAD, so we can punt to that issue to fix them.
The additional fails that are in #5 demonstrate that we do have adequate tests (once we fix drupalPostAjax() itself in that other issue) that would have caught #4 having a bug (including the impact to Field UI originally reported in #1938980-22: Fix Ajax system; the last remnants of the old API must be swept away that required us to rollback that initial commit). That these tests do not fail in #6 demonstrate that the fix (same one in both #6 and #7) works.
As long as Crell approves this interdiff, I think #7 can be RTBC'd.
Comment #11
larowlan+1
Comment #12
Crell CreditAttribution: Crell commentedAhhh... #10 makes sense. Thank you for clarifying; I was about to have a heart attack. :-)
Interdiff makes sense, and may actually help unblock #1938980: Fix Ajax system; the last remnants of the old API must be swept away at least a bit. So, now RTBC for #7. Thanks, Alex!
Comment #13
webchickNo longer applies. :(
But Alex just walked me through it and I'm comfortable committing when it's ready. Seems good to separate these out into pluggable route enhancers rather than a huge gunky bunch of ifs/elses.
One thing I'd be curious to know is if we can un-comment the test at this point now that we've added the missing reference to legacy blah blah thing.
Comment #14
tim.plunkettIt only conflicted because #1847768: Remove ip_address() added reverse_proxy_subscriber right where this patch was moving stuff around, no actual conflicts.
Trying with an without that test commented out.
Comment #15
effulgentsia CreditAttribution: effulgentsia commentedThe reason the uncommented test fails is that the above is checking that
_content
is empty instead of_controller
being empty. The other enhancers check for empty_controller
, which makes more sense, because the idea is that you want to apply a default _controller when there isn't one already. However, the above line is the same as what is already in the RouteProcessorSubscriber being removed, and this issue is only about moving that code, not fixing it. #1938980: Fix Ajax system; the last remnants of the old API must be swept away is the issue in which that line can be fixed, once we fix our other HEAD problems involving competing AJAX systems and simpletest testing the wrong one.So, RTBC for the green patch in #14.
Comment #16
alexpottSome minor nits... would love to unblock this to get stuff moving...
Missing param...
@inheritdoc
Missing param
Missing param
Missing doc block
Comment #17
larowlanAs promised on IRC
Comment #18
Crell CreditAttribution: Crell commentedUnless testbot says no... (which it shouldn't, as this is all comment changes)
Comment #19
alexpottCommitted 99b39dc and pushed to 8.x. Thanks!
Comment #20
larowlanChange notice for review is here: https://drupal.org/node/2012100
Comment #21
Crell CreditAttribution: Crell commentedyay!
Comment #23
xjmUntagging. Please remove the tag when the change notification task is completed.