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.
In chrome, I get weird JS errors in the console, which are useless because of #1639012: Guard against broken behaviors.
Reverting that patch, I see errors since a variable is undefined?!
But fixing that doesn't solve the problem.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal-1879240-3.patch | 972 bytes | dawehner |
#1 | vdc-1879240-1.patch | 1 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettI can't believe this is causing JS errors.
Comment #2
tim.plunketttagging
Comment #3
dawehnerTo meet the coding style of the other parts, this seems to fit better.
Comment #4
nod_Related ? #1875632-13: JS settings merging behavior: preserve integer keys (allow for array literals in drupalSettings)
Comment #5
nod_The undefined thing is causing errors because of "use strict"; it will error out if there are implicit global variables declared, like here.
Comment #6
dawehner@nod_
Which of the two approaches is the way to go forward on this issue?
Comment #7
nod_for the sake of consistency it should be #1 although I agree that ideally #3 would be the prefered format.
so I'd say #1 and if we get around fixing the declaration it should be for all of core js.
Comment #8
nod_tags
Comment #9
dawehnerWell, there are more then just two different for loops in this file so 1) might actually be less consistent.
Comment #10
nod_oh that's true, I was looking at the rest of core but in this file it's different. Views js needs love anyway so either works, I don't mind.
Comment #11
dawehnerTo be honest, personally I really prefer the #1 style, as it's more consistent with the rest of Drupal core, so basically let's do that.
Comment #12
catchHmm I like #3 better :P
Is the issue to consolidate this open already? I'll commit whichever patch once it is.
Comment #13
dawehnerI guess we simply can't decide it: Either throw a coin or just use #3 as you liked it better :)
Comment #14
dawehnerSo #3 is better :)
Comment #15
webchickCommitted and pushed to 8.x. Thanks!