I am using the search and replace scanner for a drupal 7 project. I haven't yet played with replace functionality, but find the search IMMENSELY helpful.

I am hitting a few JS issues with the default module:
- JS is being included in the page twice ('scope' => JS_DEFAULT is invalid)
- The '$' jQuery variable is causing JS conflicts
- The return values of TRUE and FALSE are invalid JS values - FALSE is not preventing the page from submitting
- Strings used in the JS are not passed through the t() function, though in the PHP they are, creating a potential issue for non-English users
- The error class is not being removed from the search field after a user starts entering new characters

I am attaching a patch to address these issues.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brettbirschbach’s picture

Title: JavaScript bugs w/7.x version » JavaScript bugs w/7.x version (Patch Attached)
brettbirschbach’s picture

Status: Active » Needs review
zany’s picture

Status: Needs review » Reviewed & tested by the community

This is a short and clean patch. Applies and works for me.

karenann’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review
FileSize
2.77 KB

When I ran this patch, I got:

% git apply -v scanner-7-js.patch
scanner-7-js.patch:31: trailing whitespace.
        searchfield.removeClass('error');	
fatal: corrupt patch at line 60

It was just an errant tab at the end of that line. I removed it and am resubmitting the patch for the auto testing thing.

fizk’s picture

Title: JavaScript bugs w/7.x version (Patch Attached) » JavaScript bugs with 7.x version
Status: Needs review » Fixed

Committed, thanks!

  • fizk committed b5c105f on 7.x-1.x
    Issue #1789136 by HitmanInWis, karenann: JavaScript bugs with 7.x...
  • ericras committed a30a704 on 7.x-1.x
    Issue #1789136: JavaScript bugs w/7.x version
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

brettbirschbach’s picture