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.

CommentFileSizeAuthor
#1 coder-warning-js-wrapper-668314-1.patch659 byteserickbj
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

erickbj’s picture

Version: 7.x-1.x-dev » 7.x-2.1
Category: Task » Bug report
Issue summary: View changes
FileSize
659 bytes

This 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.

David_Rothstein’s picture

Status: Active » Needs review
vmachado’s picture

Status: Needs review » Reviewed & tested by the community

Suggested patch is working fine.

klausi’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Coder 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.