Problem/Motivation
See #2999721: [META] Deprecate the legacy include files before Drupal 9
Proposed resolution
Move functions into the shutdown handler class methods.
Remaining tasks
Review
Deprecate shutdown functions
Convert functions into shutdown handler
Replace usages of the deprecated functions with the new shutdown handler calls.
User interface changes
-
API changes
drupal_register_shutdown_function, _drupal_shutdown_function, and _drupal_shutdown_function_handle_exception are deprecated in favor of a handler.
Data model changes
-
Release notes snippet
-
| Comment | File | Size | Author |
|---|---|---|---|
| #37 | 3053773-nr-bot.txt | 90 bytes | needs-review-queue-bot |
Issue fork drupal-3053773
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
volegerHere the patch
Comment #3
borisson_This patch no longer applies, and it looks like something completely breaks all the tests.
Comment #4
volegerYeah, the CS fixes in bootstrap.inc breaks the patch apply.
Rerolled.
Comment #5
kim.pepperTests failing mostly to do with
Comment #6
kim.pepperComment #7
volegerThanks @kim.pepper
Finally figured out the issue source - during some refactoring missed the renaming of the class file name.
Attached just reroll - there was added new shutdown function tests, so there are replacements and test method renames, see
core/tests/Drupal/KernelTests/KernelTestBaseShutdownTest.phpAnd patch with the fixes - see interdiff file:
-
core/lib/Drupal/Core/Utility/Shutdown.php->core/lib/Drupal/Core/Utility/ShutdownHandler.php-
public function shutdown() {->public static function shutdown() {Comment #8
andypostLooks nice start, error handling only needs polishing
Comment #9
volegerSure. But we have a separate issue for that #3000229: Add DrupalErrorHandler wrapping Symfony ErrorHandler component. Here we have just conversion of Shutdown handler functions.
Comment #10
volegerUpdate IS
Comment #11
berdirThis by reference stuff feels icky, wondering if we should have explicit get/set methods now that it is a class?
the drupal_static() documentation feels a bit off now, but not sure what else to say. Maybe the class could explain why it can't be a service, and then it is implied that it has to be static?
can we define this using the ... variable length thing now?
can we type hint this now that we require php7?
docblock needs an update.
Do we really still need this check? When cold it possibly not exist?
Comment #21
volegerAddressed #11. Rerrolled the patch in the MR. Updated CR
Comment #22
smustgrave commentedApplied the MR and searched for drupal_register_shutdown_function and seems all instances have been replaced.
Only question is the formatting of the trigger_errors. Not sure it matters but wanted to flag for committers.
Comment #23
alexpottI've added some comments to the MR.
Comment #24
volegerAddressed #23
Comment #25
smustgrave commentedfeedback appears to have been addressed. Left a note in IS that an api change is being proposed.
Comment #26
volegerI updated CR per Slack feedback. Also updated Error::shutdownExceptionHandler definition.
Comment #27
quietone commentedNice to see a reduction in the 'includes'!
I'm triaging RTBC issues. I read the IS, the comments, the change record and the MR. I didn't see any unanswered questions.
When setting an issue to RTBC the comment should explain what one did to determine the issue was ready for commit to core. For example, did you see something you liked or disliked, what core gates did you check, etc.
I looked at the comments raised by alexpott in the MR and see that they have been marked 'resolved' by the person who made the changes. I do not see any comment from another person that those changes have been reviewed. Therefor, I am setting this back to NR.
I made minor changes to the change record.
Comment #28
smustgrave commentedSome small changes. Rebased as the current MR didn't have the pipeline code yet.
Comment #29
volegerRebased, addressed review comments. Thanks
Comment #30
smustgrave commentedSeems to have code failure, have not re-reviewed yet.
Comment #31
volegerNew tests require strict_types declaration. Fixed
Comment #32
smustgrave commentedStill appears to have failures in MR.
Comment #33
volegerFixed issue with parameter initialization. Ready for the review.
Comment #34
smustgrave commentedChanges look good to me, and feedback addressed.
+1 RTBC but per new approach for #needs-review-queue-initiative going to leave in NR for a few days for additional eyes.
Comment #35
smustgrave commentedGoing to go ahead and mark it, been a few days.
Comment #36
quietone commentedChecking the RTBC queue.
Ah, this is the issue where I commented about the same person making changes in response to comments in MR and them setting those comments to resolved. At the time I didn't realize there are limitations on who can resolve comments.
There have been some changes to the MR but mostly just keeping it up to date.
Leaving at RTBC.
Comment #37
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #38
alexpottThis will need to make changes due to #3405976: Transaction autocommit during shutdown relies on unreliable object destruction order (xdebug 3.3+ enabled) as that ended up adding a shutdown function.
Comment #40
volegerRerolled
Comment #41
dcam commentedI found a bunch of documentation changes to make. Some are due to recent changes in documentation standards, added long after work on this patch started. Some are kind of nitpicky. Some are due to needing better grammar. Please consider them.