Updated: Comment #0
Problem/Motivation
#2187735: Add removal information to docblock of all @deprecated functions ensured that most @deprecated functions were marked "will be removed before Drupal 8.0". Now we just need to live up to that promise.
Proposed resolution
Remove the functions, first by removing uses of the functions, then later by removing the functions themselves.
Search the code base for @deprecated to confirm that this issue has been resolved. Our aim is that no functions will be marked @deprecated unless they are in a vendor directory (i.e. not code that we should modify).
Beta policy
Non-disruptive patches for this issues will be accepted during beta, based on the rules defined in https://www.drupal.org/core/beta-changes. Patches are likely to be considered too disruptive if they change a large number of files, as these will cause many other, more important, patches to require rerolls.
Remaining tasks
Remove uses of the functions, then later remove the functions. Many issues below are already "needs review". You can help us most by reviewing those issues so they can be committed.
All removal issues should have the @deprecated tag. This is tagged "revisit before release candidate" so that we know how much of a problem this is come release candidate time, but we can easily slip that to "revisit before release".
git grep --after-context 8 '@deprecated' | grep "function " | grep -v 'vendor' | rev | cut -c 2- | rev
Then a little bit of clean for a total of 196 deprecated functions:
Many more issues were covered by #2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method calls
User interface changes
None
API changes
Several API functions removed.
No @deprecated API functions remaining.
Beta phase evaluation
Issue category | Task. Work must be done to remove all @deprecated code before 8.0.0 release. |
---|---|
Issue priority | Normal because Drupal 8 still works with these deprecated functions still in place. |
Prioritized changes | The main goal of this issue is removing code already deprecated for 8.0.0. |
Comments
Comment #1
ianthomas_ukComment #2
heddnComment #3
XanoComment #4
heddnComment #5
JeroenTComment #6
JeroenTComment #7
JeroenTComment #8
marcingy CreditAttribution: marcingy commentedComment #9
marcingy CreditAttribution: marcingy commentedComment #10
LinL CreditAttribution: LinL commentedComment #11
LinL CreditAttribution: LinL commentedComment #12
LinL CreditAttribution: LinL commentedComment #13
LinL CreditAttribution: LinL commentedComment #14
marcingy CreditAttribution: marcingy commentedComment #15
marcingy CreditAttribution: marcingy commentedComment #16
marcingy CreditAttribution: marcingy commentedComment #17
marcingy CreditAttribution: marcingy commentedComment #18
marcingy CreditAttribution: marcingy commentedComment #19
LinL CreditAttribution: LinL commentedShould we be adding a Change record to the tasks that remove the deprecated function? Or maybe have one Change record for all of them?
Comment #20
bfr CreditAttribution: bfr commentedComment #21
bfr CreditAttribution: bfr commentedComment #22
alimac CreditAttribution: alimac commentedAdded child issue #2299253: Remove language_access_language_edit_or_delete function.
Comment #23
alimac CreditAttribution: alimac commentedComment #24
alimac CreditAttribution: alimac commentedComment #25
bfr CreditAttribution: bfr commentedComment #26
bfr CreditAttribution: bfr commentedComment #27
bfr CreditAttribution: bfr commentedComment #28
ianthomas_ukComment #29
MKorostoff CreditAttribution: MKorostoff commentedComment #30
tim.plunkettComment #31
slashrsm CreditAttribution: slashrsm commentedComment #32
slashrsm CreditAttribution: slashrsm commentedComment #33
a_thakur CreditAttribution: a_thakur commentedComment #34
a_thakur CreditAttribution: a_thakur commentedComment #35
a_thakur CreditAttribution: a_thakur commentedComment #36
a_thakur CreditAttribution: a_thakur commentedComment #37
daffie CreditAttribution: daffie commentedComment #38
a_thakur CreditAttribution: a_thakur commentedComment #39
a_thakur CreditAttribution: a_thakur commentedComment #40
mikey_p CreditAttribution: mikey_p commentedComment #41
mikey_p CreditAttribution: mikey_p commentedComment #42
a_thakur CreditAttribution: a_thakur commentedComment #43
penyaskitoComment #44
penyaskitoComment #45
penyaskitoComment #46
penyaskitoComment #47
penyaskitoComment #48
JeroenTComment #49
a_thakur CreditAttribution: a_thakur commentedComment #50
a_thakur CreditAttribution: a_thakur commentedComment #51
a_thakur CreditAttribution: a_thakur commentedComment #52
a_thakur CreditAttribution: a_thakur commentedComment #53
clemens.tolboomComment #54
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedComment #55
a_thakur CreditAttribution: a_thakur commentedComment #56
a_thakur CreditAttribution: a_thakur commentedComment #57
jbrown CreditAttribution: jbrown commentedComment #58
ashutoshsngh CreditAttribution: ashutoshsngh commentedComment #59
ashutoshsngh CreditAttribution: ashutoshsngh commentedComment #60
jbrown CreditAttribution: jbrown commentedComment #61
a_thakur CreditAttribution: a_thakur commentedComment #62
a_thakur CreditAttribution: a_thakur commentedComment #63
a_thakur CreditAttribution: a_thakur commentedComment #64
leeotzu CreditAttribution: leeotzu commentedComment #65
leeotzu CreditAttribution: leeotzu commentedComment #66
leeotzu CreditAttribution: leeotzu commentedComment #67
arpitr CreditAttribution: arpitr commentedComment #68
arpitr CreditAttribution: arpitr commentedComment #69
arpitr CreditAttribution: arpitr commentedComment #70
crazyrohila CreditAttribution: crazyrohila commentedComment #71
ianthomas_ukComment #72
yannisc CreditAttribution: yannisc commentedComment #73
yannisc CreditAttribution: yannisc commentedComment #74
yannisc CreditAttribution: yannisc commentedComment #75
yannisc CreditAttribution: yannisc commentedComment #76
legolasboComment #77
legolasboComment #78
legolasboComment #79
legolasboComment #80
ianthomas_ukAdd format_string()
Comment #81
ianthomas_ukComment #82
Les LimAdded mail.inc deprecated functions.
Comment #83
Les LimComment #84
a_thakur CreditAttribution: a_thakur commentedComment #85
a_thakur CreditAttribution: a_thakur commentedComment #86
xjmComment #87
rpayanmComment #88
andypostComment #89
JeroenTComment #90
JeroenTComment #91
rpayanmComment #92
ianthomas_ukRemoved the following functions from the main table to make it more readable - these are all marked fixed.
2228741
Comment #93
ianthomas_ukRemove several more functions
Comment #94
ianthomas_ukMore already fixed function, and link several 'Remove function' issues.
Comment #95
ianthomas_ukComment #96
ianthomas_ukAdd #2382545: Cleanup drupal_process_attached and _drupal_add_* documentation and remove more functions that have gone.
Comment #97
rpayanmComment #98
rpayanmComment #99
LinL CreditAttribution: LinL commentedAdding #2383727: Remove form_options_flatten() as it is deprecated
Comment #100
rpayanmComment #101
rpayanmComment #102
ianthomas_ukdrupal_add_js/css due to be removed in #2368797: Optimize ajaxPageState to keep Drupal 8 sites fast on high-latency networks, prevent CSS/JS aggregation from taking down sites and use HTTP GET for AJAX requests
Comment #103
msankhala CreditAttribution: msankhala commentedComment #104
msankhala CreditAttribution: msankhala commentedComment #105
ianthomas_ukAdd #2367743: Remove usages of drupal_form_submit() and update documentation
Comment #106
ianthomas_ukComment #107
ianthomas_ukFix element_* links.
Comment #108
ianthomas_ukUpdate conf_path issue #
Remove another set of fixed issues:
Comment #109
a_thakur CreditAttribution: a_thakur commentedComment #110
a_thakur CreditAttribution: a_thakur commentedComment #111
a_thakur CreditAttribution: a_thakur commentedComment #112
a_thakur CreditAttribution: a_thakur commentedComment #113
fotuzlab CreditAttribution: fotuzlab commentedComment #114
a_thakur CreditAttribution: a_thakur commentedComment #115
a_thakur CreditAttribution: a_thakur commentedComment #116
fotuzlab CreditAttribution: fotuzlab commentedComment #117
a_thakur CreditAttribution: a_thakur commentedComment #118
ianthomas_ukUpdated some issue links and removed more functions that have already gone:
Comment #119
a_thakur CreditAttribution: a_thakur commentedComment #120
Mile23Added beta evaluation.
Comment #121
Mile23Overlap here: #2093143: [meta] Remove calls to @deprecated and "backwards compatibility" procedural functions from core
Comment #122
valthebaldComment #123
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #124
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #125
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #126
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #127
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #128
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #129
Noe_ CreditAttribution: Noe_ at Devhouse Spindle commentedComment #130
cilefen CreditAttribution: cilefen commentedComment #131
Mac_Weber CreditAttribution: Mac_Weber as a volunteer commentedComment #132
ianthomas_ukRemove functions from this issue that are not due to be removed until Drupal 9:
file_load
file_load_multiple
Removing fixes issues from issue summary:
Comment #133
catchThis looks really close, to the point where I think if there are one or two left at the end, we should consider updating the documentation if they don't happen before release candidate. However we can still commit these right up until the first release candidate. Untagging.
Comment #134
Mile23#2549041: Remove deprecated _drupal_set_preferred_header_name() removes
_drupal_set_preferred_header_name()
.Comment #135
ianthomas_ukHTTP headers handled in #2467759: Refactor drupal_process_attached() so it doesn't depend on drupal_add_http_header()
Comment #136
ianthomas_ukComment #137
ianthomas_ukLink to more issues
Comment #138
ianthomas_ukFix header removal function links
Comment #139
Mile23A bit of an API snag here: #2555069: Remove invocation of hook_html_head_alter()
Comment #140
ianthomas_ukRemove more that have been fixed:
Add SafeMarkup::checkPlain()
Comment #141
ianthomas_ukI've gone through HEAD, and every instance of @deprecated is either:
Comment #142
ianthomas_ukRemove some more functions - this meta is now fully up to date:
Fixed
bootstrap.inc drupal_page_header() #2184907: Remove uses of drupal_add_http_header and related functions #2362123: drupal_page_header() and drupal_send_headers() are dead code: already deprecated, zero uses remain: remove
lib/Drupal/Component/Utility/String.php #2457781: Use Utility\Html class instead of Utility\String for decodeEntities() function #2458387: Remove Utility\String class
lib/Drupal/Component/Utility/String.php #2476075: Remove usage of \Drupal\Component\Utility\String::format()
Not deprecated for 8.x
bootstrap.inc format_string() #2228741: Replace calls to format_string() with Drupal\Component\Render\FormattableMarkup
Drupal.php public static getContainer() (no issue)
Core/Template/TwigExtension.php (file doesn't exist and linked issue was not relevant)
Comment #143
Mile23Should really be critical, but I don't run the world.
Comment #144
webchickI can't think of a reason why we would not ship D8 if this wasn't done. However, it does definitely need to get done before RC if we're going to do it, so tagging.
Comment #145
joelpittetTweak the grep because vendor moved to root.
I guess we'll likely need to move this to 8.1.x since RC is out. They are still marked deprecated the deadline for removing them has past.
The biggest hunks seems to be db_ functions file functions.
Comment #146
ianthomas_ukI can't run the grep at the moment, but I'd guess it's picking things up that were deprecated in D8, to be removed in D9.
We're not allowed to remove functions in D8.1 unless we really, really need to, so there's basically no more removal of functions to be done in the short to medium term. Based on the issues in the issue summary, it should just be getPathFromRoute() and getInternalPath() that we weren't able to remove in time. We now need to update the documentation for these so they say "will be removed in Drupal 9".
We may want to file a new meta to remove usages of deprecated functions so we're ready for Drupal 9, but I don't think there's too much value in doing that now (lots of it will just happen naturally before then anyway as code gets rewritten). We can of course upgrade things to take advantage of new APIs where available.
Comment #147
Mile23...Thus illustrating a major flaw in a criticals-based release process.
Anyway, yes, here's what remains:
UrlGeneratorInterface::getPathFromRoute()
#2307061: UrlGeneratorInterface::getPathFromRoute() is marked deprecated but will not be removed, so update the docsUrl::getInternalPath()
#2367753: \Drupal\Core\Url::getInternalPath() cannot be deprecatedThese deprecations should occur, and those methods should be removed from core, if they really are deprecated.
If they're not deprecated, then a maintainer should say so.
Setting RTBC in hopes of getting maintainer input.
Comment #148
tim.plunkettNot appropriate usage of priority or status.
Comment #149
Mile23Hah, just saw webchick's post and came back to change this.
https://groups.drupal.org/node/486388
Comment #150
xjmSince this is a meta and different removals of different deprecated functions have different impact, let's instead tag any outstanding child issues for triage individually.
Comment #151
Mile23See: #2205685: Review @deprecated functions that are not marked "will be removed before Drupl 8.0"
Comment #155
martin107 CreditAttribution: martin107 as a volunteer commentedI think this is done? ... all the child issues are complete
No activity since 2015
Comment #156
cilefen CreditAttribution: cilefen commentedAll I found were these:
Comment #157
martin107 CreditAttribution: martin107 as a volunteer commentedcilefen++ That git grep is a really useful command
Just for the record
It looks like you did that on the 8.4.x branch .. or at least the results are the same.
I don't think it is worth promoting a fixed issue 8.3.x upto 8.4.x
Comment #158
martin107 CreditAttribution: martin107 as a volunteer commentedcleanup on aisle 8.4