Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Earlier in the D7 cycle, core used to pop up such a warning in an alert box, but it was recently removed because that kind of warning is not appropriate to include in core (see #654964: Remove babysitting for $()).
However, it was pointed out that it might be useful to add such a warning in the Coder module, so I'm creating this issue for that.
Comment | File | Size | Author |
---|---|---|---|
#1 | coder-warning-js-wrapper-668314-1.patch | 659 bytes | erickbj |
Comments
Comment #1
erickbj CreditAttribution: erickbj commentedThis verification is present in the 7.x-2.1 version but is buggy - meaning that having a
(function ($) {
line in your JS code still triggers the review error.That happens because the review rule is missing a configuration (
#source
) and when the rule processor runs the rule (upgrade7x_64) it's not reading the actual file source code (it comes empty).The attached patch solves the issue for 7.x-2.1. The rule definition is the same in 7.x-2.x-dev so I suppose the bug is there too, although I haven't checked that.
Comment #2
David_Rothstein CreditAttribution: David_Rothstein commentedComment #3
vmachado CreditAttribution: vmachado as a volunteer and at CI&T commentedSuggested patch is working fine.
Comment #4
klausiCoder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.