Problem/Motivation
Based on the #2999721: [META] Deprecate the legacy include files before Drupal 9 we can remove already deprecated include files and all related calls to the files or functions.
Proposed resolution
Remove related code from the codebase.
Remaining tasks
- Remove include files that contains already deprecated and replaced API.
- Remove related legacy test code.
User interface changes
-
API changes
Legacy API removal from deprected include files.
Data model changes
-
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | 3062757-30-D8-reference-fixes.patch | 4.2 KB | berdir |
| #29 | 3062757-29.patch | 267.05 KB | andypost |
Comments
Comment #2
volegerJust trying to remove first 4 fully deprecated files with Legacy API.
Comment #3
volegerMissed a few includes.
Comment #4
volegerLooks like we need to finish deprecation of
user_delete_multiple(anduser_delete).The deprecated code shouldn't use deprecated API. I'll fill followup issue.
Comment #5
volegerComment #6
volegerFilled followup #3062806: Properly deprecate user_delete() and user_delete_multiple()
Comment #8
voleger#3087546: Remove deprecated entity manager covers entity.inc file so it out of the scope of this issue.
Comment #9
volegerHere the patch.
There are removals of all deprecated API calls from include files except entity.inc file and REQUEST_TIME constant which is deprecated but actually not fully replaced.
Comment #10
berdir> PHP Fatal error: Uncaught Error: Call to undefined function drupal_set_time_limit() in /var/www/html/core/scripts/run-tests.sh:162
Looks like we missed a call ;)
That should be backported to D8 I suppose, so separate issue maybe?
Comment #11
volegerReplaced the last call of the drupal_set_time_limit() in run-test.sh
Comment #12
volegerUpdate LoggingTest and remove call of removed function from the install tasks
Comment #14
volegerRemoved additional legacy tests that are related for current removals.
Also reverted some changes to simlpetest module. Just keep removed the required method and related call.
Comment #15
volegerAdd related META
Comment #16
volegerComment #17
voleger#10 Addressed, followup added #3092268: Replace call of deprecated drupal_set_time_limit() function
Comment #18
andypostbtw Maybe better to split this patch into per-file base to make it easy reviewable?
Comment #19
berdirThat's up to framework managers, but IMHO, this is pretty fine, these kind of patches are fairly easy to review. What's more important is that we separate non-test calls out into separate issues that can be backported, like already done in #17.
Comment #20
martin107 commentedThanks voleger -- for persisting with this issue.
I see 4 additional coding standard bugs in the test output
It is the curse of the unused used statement.
Comment #21
volegerAddressed CS issues
Comment #22
andypostI think it needs 2 follow-ups because there's a changes which are out of scope and they backportable
This needs separate issue to clean-up mentions of deprecated functions, it is backportable to 8.8.x at least
Probably it needs separate quickfix for this inconsistency
Comment #23
berdir1.
time limit already has a (RTBC) issue.
The file comment references, yeah, maybe, not sure if it's worth it, it's nothing functional.
2. This referes IIRC a (legacy) test function that is removed in this patch, it still exists in 8.x and is not removed.
Comment #24
andypostFiled patch #22.2 #3092791: Fix wrong reference to testEscapeString() from SafeMarkupTest.php
Comment #25
dwwRight, time_limit is at #3092268: Replace call of deprecated drupal_set_time_limit() function
Comment #26
voleger#3092268: Replace call of deprecated drupal_set_time_limit() function is in.
Comment #27
andypostPager also in separate issue #3087517: Remove BC layer for Pager service
Comment #28
berdirAnd the issue in #24 is IMHO no longer a blocker, per my comment there. On 8.x, the method name is just wrong but still exists, so that issue fixes that and here we can remove it.
So, lets reroll this without the pager part :)
Comment #29
andypostAttempt to re-roll after pager fixed
Comment #30
berdirThere are 141 @deprecated within core/includes before the patch and just one after applying it, that is the REQUEST_TIME constant that we can't remove yet. And there are no @trigger_error() left, 113 are removed by the patch.
What this issue doesn't cover is related constructor deprecations in services/controllers/forms/.. that were introduced as part of the deprecation removal of the functions that we remove here, e.g. file_system. But I think unlike the entity manager, where that included instanceof checks of the removed interface, these are easier to detect and remove in the issues for the respective modules/components.
I also had a look at the remaining contents of these include files and while it is unfortunate that we couldn't finish some of the ongoing deprecations in time, like drupal_get_filename(), render() related things or file_create_url(), there isn't too much left and I think we could in a follow-up see if some of the left-overs could be merged into common.inc, so have to load fewer files on every request.
There are still a handful of deprecated function removals that could possibly be backported to D8, I extracted them in the attached patch, with the following command. It's only pseudo-code in hook examples and documentation, so nothing functional:
I think getting this in asap is beneficial to being able to do real tests against D9 for contrib modules. According to https://dev.acquia.com/drupal9/deprecation_status/graphs#topErrorStatus, this removes 7 of the top 15 deprecated things, with only simpletest, getMock(), Drupal:: methods and Unicode left. And it looks ready to me, so RTBC.
Comment #31
alexpottCommitted 144c05e and pushed to 9.0.x. Thanks!
Comment #32
alexpottI also committed #30... Committed and pushed 91f4c1edfe to 8.9.x and d68d8dfa42 to 8.8.x. Thanks!
As these are docs backports to 8.8.x and 8.9.x. I'm leaving the issue at 9.0.x because that's where the bulk of this work is done.
Comment #36
dwwThanks for all the great work in here! Very exciting to see so much of this code going away.
I wish d.o made it easier to associate realistic git commit messages with individual patches, not the entire issue. Seeing commit d68d8df on the 8.8.x branch seems like a cherry-pick error:
"Issue #3062757 by voleger, Berdir, andypost: Remove deprecated legacy include files from Drupal 9"
That should have said something like:
"Issue #3062757 by voleger, Berdir, andypost: Fix documentation to not reference deprecated functions" (more or less).
Commenting here for posterity, in case anyone is looking at the git logs, confused, opens this issue, and happens to find this. ;)
Cheers,
-Derek
Comment #37
alexpott@dww I should have fixed that on commit and put a better title in. My bad.
Comment #38
dww@alexpott No worries! It totally happens. Y'all core committers have plenty to worry about, already. That's why I was saying I wished d.o made this task easier for you. Oh right, I (used to) maintain all those tools. Perhaps I should fix it. ;)
Cheers,
-Derek