Just like #1591690: Remove drupal_page_footer(), ajax_footer() has also been replaced with the new kernel model.
ajax_footer() did that subset of things to terminate a request, that doesn't require a full bootstrap. Currently we're doing full bootstraps anway, so everything is taken care of by the new request close subscriber. (Later we might get to a point, where we only bootstrap what's needed, but that's not to be solved, here.)
TODO: Remove the function and all references.
Comment | File | Size | Author |
---|---|---|---|
#14 | 1618072-14.patch | 380 bytes | swentel |
#8 | 1618072-remove-ajax-footer-5.patch | 1.86 KB | Niklas Fiekas |
#1 | 1618072-remove-ajax-footer-1.patch | 1.08 KB | Niklas Fiekas |
Comments
Comment #1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedFound no references, just the function itself.
Comment #2
nod_Same here.
Comment #3
sunI'd prefer to port this conditional shutdown into onTerminate instead. Without doing so, there's a huge chance that we'll forget about that special case.
Comment #4
aspilicious CreditAttribution: aspilicious commentedsun how do you see this happening? You have to register the onTerminate stuff and than it gets called automagicly. How do you define that the evenSubscriber only gets called on ajax requests?
Comment #5
aspilicious CreditAttribution: aspilicious commentedWe maybe can copy the same approach as with the viewSubscriber
We can pass negotiation to the closeSubscriber and than look if it's an ajax request and close it properly.
It's actually the same code as we have now on the terminate side only we should stop after "drupal_session_commit();" when we are dealing with an ajax request.
Comment #6
sunI'd simply move the conditional structures from ajax_footer() into the current, existing onTerminate(). No special-casing for Ajax.
Comment #7
aspilicious CreditAttribution: aspilicious commentedAre you sure we still can run in that edge case with the kernel system?
I thought that on the moment we are in the terminate process the "DRUPAL_BOOTSTRAP_FULL" stage is always started.
If I understand the symfony stuff the onTerminate gets called when we call terminate on the request.
And I'm not sure the maintenace mode stuff is needed either...
Comment #8
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedLooking at:
Both extra checks are to allow running without a fully bootstrapped Drupal. Right now we have to boostrap anyway, to let the kernel handle requests. The only chance of changing that, is getting away from "all-or-nothing" bootstraps. That is clearly on the agenda.
Then, looking at:
These are the additional things that are done:
Comment #9
sunHm. Well. Ok, let's just simply hope that something like http://drupal.org/project/js won't be required for D8 at all anymore (which is basically the reason for why most of these special conditions exist, since the idea of that is to use a completely custom js.php front controller that bootstraps... almost nothing. And with nothing, I literally mean it).
Comment #10
neclimdulThe state of the bootstrap is very confusing at the moment. We do /not/ run in a full bootstrap in the kernel. If you are running a legacy callback then you'll get the full bootstrap through LegacyRequestSubscriber. This can bite you if you're not aware of it.
As for your js project, you could do different bootstrap/request handling/front controller stuff by providing your own kernel and request handler. This actually provides you better control without weird special cases because you can control the entire stack. I do agree that hopefully we don't need it though.
+1 on the RTBC
Comment #11
catchdrupal_cache_system_paths() and module implements caching can both be got rid of by converting those respective caches to CacheArray (one has a patch, one will soon).
Cron is strange anyway, I don't see a particular reason to avoid that check on AJAX requests compared to on any other request.
@neclimdul doesn't the Kernel do DRUPAL_BOOTSTRAP_CODE? That's almost copy and pasted from DRUPAL_BOOTSTRAP_FULL so it's effectively a full bootstrap in the sense that required procedural code in /includes and all modules get loaded.
Comment #12
neclimdulYeah, BOOTSTRAP_CODE is basically BOOTSTRAP_FULL but checks like this against it fail. But they do only when going through index.php because non kernel bootstraps like the test runner still BOOTSRTAP_FULL. hense being a bit inconsistent and confusing.
Comment #13
catchThanks. Committed/pushed to 8.x.
Comment #14
swentel CreditAttribution: swentel commentedSorry to reopen, there was still a call in ajax_deliver() to ajax_footer(), should be removed as well.
Comment #15
swentel CreditAttribution: swentel commentedOk, nevermind, #1622934: Replace delivery callbacks by leveraging the HTTP kernel, fix the overlay module is going to removed ajax_deliver().
Comment #16
Jelle_SI was working on a module update to D8, when I got the error 'call to undefined function ajax_footer'. I searched the change notifications, but didn't find anything, until I came here. Might be useful to make a change notification for this? Because it is unclear to me what should happen. Should developers just remove the function wherever they use it, or is there a replacement function/system?
Comment #17
sunI think they are all summarized in a single change notice?
Nevertheless, adding the API change tag, so this appears at least in the @drupalchanges stream (with status "fixed").
Comment #18
Jelle_SI searched for it But couldn't find it though. Or am I looking in the wrong place?
Comment #19
sunThe central/summarized change notice is http://drupal.org/node/1635626
I do not think that this issue needs an own change notice, so reverting status to fixed.