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.
Settings has group -100 like jquery and weight 0
It must be placed after jquery.once.js, not after all scripts
If the correct order, I can use the data from the settings in all my scripts without waiting for the event document.ready
Comment | File | Size | Author |
---|---|---|---|
#8 | 1710002-8.patch | 688 bytes | star-szr |
#1 | common.inc_.patch | 726 bytes | Punk_UnDeaD |
Comments
Comment #1
Punk_UnDeaDComment #2
dealancer CreditAttribution: dealancer commentedComment #4
nod_I tend to agree with this.
Needs to be fixed in D8 first then backported.
Comment #5
nod_Weight is now -200 on D8 for settings.
Comment #6
dealancer CreditAttribution: dealancer commentedWhoohoo, was it committed or solved in other issue?
Comment #8
star-szrRe-opening, this is a bug and can still be fixed in D7. Ran into this when trying to use Drupal.settings in JavaScript included via a theme's .info file.
An inline comment in drupal_add_js() states:
Comment #9
star-szrComment #10
star-szr#8: 1710002-8.patch queued for re-testing.
Comment #11
nod_If you try accessing settings outside a behaviour or before the ready jquery thing. All bets are off.
Comment #12
star-szrThanks @nod_. Fair enough :) So won't fix for D7?
Comment #13
nod_For D7, pretty much, yes :)