Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jun 2012 at 15:16 UTC
Updated:
29 Jul 2014 at 20:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedPart way there, definitely needs more work. Here's a patch with most of the drupal_exit() calls removed, apart from the ones in ajax_get_form() and _form_test_submit_values_json(), which still need to be removed along with the function itself. Not touched the other exit calls as of yet.
I've tried to convert everything so far to a Response or RedirectResponse, apart from system_php(), where I've just returned phpinfo().
Comment #2
Niklas Fiekas commentedThanks @chrisdolby! (Just sending it to the testbot for testing - although not yet complete.)
Comment #4
sunHm. There can be cases, in which removing a [drupal_]exit() could lead to security issues, because any following code in calling or even distant calling functions is not expected to be run.
We have to be sure that this is not the case for each of the removals/replacements happening here.
Comment #5
pounardI think removing the early drupal_exit() may some minor cause performance regression, but I'm not sure about security. But we have to get rid of them, because handling two different paths for closing request messes up badly with some write delayed incremental caches that could be wrote but are ignored because of that, and may cause other unexpected behavior.
Comment #6
Anonymous (not verified) commentedThis is mostly a re-post of what I'd posted before, which I'm pushing to the testbot.
The phpinfo() call needs an appropriate response closer (the page output still continues), still working on that, and the ajax_get_form() call still needs changing, as there are two potential security holes here.
I've put in a JsonResponse for form_test.module, in the hope it's going to do the job now.
Comment #8
Crell commentedThe easiest way to deal with phpinfo(), I think, is to wrap it in an output buffer, shove the results into a new Response object, and return that. We can maybe twiddle with the settings on it for caching and stuff, but that doesn't have to happen right now.
Comment #9
marvil07 commentedRe-roll including suggestion from #8.
Comment #11
catchCross-linking #1860026: Remove hook_exit() for cached page requests.
Comment #12
catchShouldn't ship with two ways to do something, so this feels at least major.
Comment #13
berdirThat will never work ;)
We need to fix #1668866: Replace drupal_goto() with RedirectResponse first.
Comment #14
ParisLiakos commentedComment #16
ParisLiakos commentedgit pull
Comment #18
ParisLiakos commentedi would love some help with openid tests, its the only that fail
Comment #20
pdrake commentedThis issue and http://drupal.org/node/1497162 appear to be duplicates. One should probably be closed and efforts combined. While http://drupal.org/node/1497162 is an earlier issue, this one has more recent work.
Comment #21
ParisLiakos commentedthere is no way we get rid of exit in current core's state. maybe after all forms convert to the FormInterface and the callbacks that call drupal_goto to routes
there is already a critical issue for that #1971384: [META] Convert page callbacks to controllers, but we should move forward here if we want to get rid of drupal_goto
Comment #22
ParisLiakos commentedrelevant #556380-70: Remove OpenID from core
Comment #23
Crell commentedCan we reroll this issue to ignore OpenID (and leave the method in place for now but marked for deletion), and see what happens?
Comment #24
ParisLiakos commentedi am retitling this issue..removing exit calls can happen after code freeze, but not removing drupal_exit..and i believe this patch is all that it takes now that openid is history
we can remove exit on #1497162: Eliminate the use of exit in core
Comment #25
Crell commentedBy convention, we've always been using new RedirectResponse() rather than ::create(). That's not a requirement but just the convention we've been using. If we need to reroll, it's probably good to switch to that.
Urk. This will conflict with #1987824: Convert system_php() to a new style controller, which got to RTBC first, so we should probably wait for that to be committed and then adjust this patch accordingly.
I'm not sure it's necessary to send() here. If you return a response object from a page callback, it should still work, shouldn't it?
Comment #26
ParisLiakos commentedYes it should work, but if i am dont send it, xmlrpc tests fail a lot..
we plan to fix xmlrpc module here #1979040: Rewrite XML RPC module to services and plugins
Comment #27
Crell commentedWeird, but OK. So I think we just need to reroll for the conflict and tweak the new/create issue, and then we're done here.
Comment #28
catchI don't think removing drupal_exit() then copying its contents to other functions is a good idea. Either it's ready to remove or it's not - we can mark it deprecated, then the two worst cases are 1. it's a wrapper for exit 2. it still has that session logic in it. I'm not sure what's going to happen to deprecated functions after code freeze, I'd lean towards removing them up until RC - just having the function there isn't such a massive blight compared to other things that are going to be left in 8.x.
This doesn't have the session handling - does it need it? Again we could just leave drupal_exit() for now and not have to worry about this until it can be nuked properly.
Comment #29
ParisLiakos commentedabout drupal_goto: #1668866: Replace drupal_goto() with RedirectResponse will make it not needing drupal_exit..i was hoping to remove drupal_exit here and then move on there, since the patch there is quite big.
about overlay: i suppose i should fix it here then
Comment #30
ParisLiakos commentedok, since #1987824: Convert system_php() to a new style controller committed, this patch fixes overlay and xmlrpc
It also proves that drupal_exit is only needed by drupal_goto at the moment. the other two form callbacks, one from test module and other from locale need to be converted to _form routes, so the @todo will be removed there
Comment #32
ParisLiakos commentedmissed some return statements on XMLRPC
Comment #33
Crell commentedI'm satisfied with the plan here. Let's do.
Comment #34
catchLooks much better now. Committed/pushed to 8.x, thanks!
Comment #35
ParisLiakos commentedchange notice https://drupal.org/node/2017339
Comment #36
Crell commentedLooks good to me.
Comment #37
effulgentsia commentedThis surfaced an error in the installer. See #1929812-14: Fatal error on web-based install.