Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
common.inc has a drupal_js_defaults()
function that has not been used in core since 2015.
It is also unused in contrib: http://grep.xnddx.ru/search?text=drupal_js_defaults&filename=
Proposed resolution
Deprecate it for removal in Drupal 10. Reword the two docblocks that still refer to it.
Remaining tasks
None
User interface changes
None
API changes
The function drupal_js_defaults()
has been deprecated.
Data model changes
None
Release notes snippet
TBD
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff_9_12.txt | 994 bytes | beatrizrodrigues |
#14 | 3197553-12.patch | 3.39 KB | beatrizrodrigues |
#9 | 3197553-9.patch | 3.39 KB | beatrizrodrigues |
#4 | 3197553-4.patch | 3.4 KB | longwave |
#3 | 3197553.patch | 3.35 KB | longwave |
Comments
Comment #2
longwaveComment #3
longwaveComment #4
longwaveChange record: https://www.drupal.org/node/3197679
Comment #7
daffie CreditAttribution: daffie commentedDeprecate in D9.4 or D10 and remove in D11.
The rest of the patch is RTBC for me.
Comment #8
beatrizrodriguesComment #9
beatrizrodriguesI did the reroll of the patch, and I also applied the changing about the deprecation message that was suggested at #7. (Changed 9.2.0 to 9.4.0 and 10.0.0 to 11.0.0).
Comment #11
Spokje(emphasis mine)
@daffie: Why deprecated in D11 instead of D10, or would that only be the case if we deprecate in D10 instead of D9.4?
Comment #12
daffie CreditAttribution: daffie commentedWe need to give site owners time to remove/change the use of the function
drupal_js_defaults()
. Say you have a Drupal site that uses that function and you want to migrate from D9.3 to D10. Your D9.3 gives you no deprecation warning message and in D10 the function is removed. That to me is not very site owner/developer friendly. Lets give contrib and custom code some time to make the change.Comment #13
daffie CreditAttribution: daffie commentedIn these lines need the deprecation message also be updated.
Comment #14
beatrizrodriguesI missed a part where the deprecation message appears.
Comment #15
beatrizrodriguesComment #16
daffie CreditAttribution: daffie commentedAll code changes look good to me.
The IS and the CR are in order.
For me it is RTBC.
Comment #17
alexpottCommitted and pushed a2c58dda71d to 10.0.x and fbcea5f26b7 to 9.4.x. Thanks!
Comment #20
alexpottI'm not sure that deprecating this for Drupal 11 is really necessary - since there is no replacement. But we can change that in a follow-up.
Comment #21
daffie CreditAttribution: daffie commentedSomebody might be using the function in some custom code. Maybe by mistake.
Comment #22
alexpottDiscussed this with the release managers (@xjm and @catch) and we agreed to deprecate this for Drupal 10. It's not that often used and if it is there is no replacement - the solution is to not use it so you don't need to be on 9.4 to fix this.
Can someone open a follow-up to change the deprecation to D10 and to remove this function on 10.0.x? Thanks.
Comment #23
SpokjeHi, I'm someone. :)
I've opened #3256518: Remove drupal_js_defaults() in D10 instead of D11 as the requested follow-up.
Comment #24
catchIssue isn't fixed yet, but we've more or less decided in #3246278: [policy] Define allowed 9.4.x/10.0.x changes to treat 9.4.x like a normal minor for deprecations - most of the 10.0.x blockers involve new deprecations, and we can't yet rule out having to release a 9.5.x.
Comment #26
quietone CreditAttribution: quietone at PreviousNext commentedAdded #3256518: Remove drupal_js_defaults() in D10 instead of D11 to the CR and published the CR.