The out_of_stock module has conflicts with JQuery Update 6.x-2.x-dev (with jquery 1.3) in the line 78 of uc_out_of_stock.js:

$("form[@id*=uc-product-add-to-cart-form]").each(function(index) {

The javascript error:

[Exception... "'Syntax error, unrecognized expression: [@id*=uc-product-add-to-cart-form]' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]

CommentFileSizeAuthor
#5 deprecated-symbol.patch2.29 KBkndr

Comments

Island Usurper’s picture

Project: Ubercart » Ubercart Out of stock Notification
Version: 6.x-2.0-rc7 » 6.x-1.4

uc_out_of_stock.js belongs to this project.

jazzitup’s picture

Firefox 3.6 throws this line in Error Console:

Uncaught exception: Syntax error, unrecognized expression: [@id*=uc-product-add-to-cart-form]

jazzitup’s picture

Priority: Normal » Critical

It kills my jQuery custom code and I can't use jQuery with this module enabled. Marking it as critical.

kmonty’s picture

Status: Active » Needs review

Using this as a guide: http://stackoverflow.com/questions/1487792/jquery-find-element-whose-id-...

changing line 78 to $("form[id*=uc-product-add-to-cart-form]").each(function(index) {
and line 91 to $("form[id*=uc-catalog-buy-it-now-form]").each(function(index) {

That said, this should be tested with the default jquery 1.2.6

kndr’s picture

StatusFileSize
new2.29 KB

Indeed, symbol @ is deprecated:

From http://api.jquery.com/category/selectors/attribute-selectors/

Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the ‘@’ symbol from your selectors in order to make them work again.

There are more deprecated symbols inside uc_out_of_stock.js. I am attaching the patch.

kndr’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
kmonty’s picture

Status: Needs review » Reviewed & tested by the community
hanoii’s picture

Status: Reviewed & tested by the community » Fixed

committed, thanks.

Status: Fixed » Closed (fixed)

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