PDA

View Full Version : [FIXED][rev 5252] "pub is not defined" error when upgrading to 3.1



rocketdave
22 Dec 2009, 4:40 PM
Hi,

I'm having trouble upgrading from 3.0.0 to 3.1.0 (or 3.0.3). We use the prototype adapter, and Firebug reports that "pub is not defined" on line 1869 of ext-prototype-adapter-debug.js. Looking at the code, it seems that it isn't defined anywhere, but maybe I'm looking in the wrong place.

It's a Rails project, and the include order is...

prototype.js (1.6.0.3)
effects.js
ext-prototype-adapter-debug.js
ext-all-debug.js

We would like to keep the prototype adapter, but are also quite keen to upgrade to 3.1.0. Any help much appreciated.

Cheers,

Dave

VinylFox
22 Dec 2009, 7:56 PM
Can you test something for me...

Edit the ext-prototype-adapter-debug.js file, replacing 'pub' with 'Ext.lib.Event' and let me know if that works.

This thread should probably be moved to the Bugs forum, but let me know if my fix works first.

rocketdave
22 Dec 2009, 8:27 PM
Seems to have done the trick. I'm not getting the error anymore, and at first glance everything seems to be behaving itself.

Thanks!

VinylFox
23 Dec 2009, 4:40 AM
Great - Ill move this to the Bugs forum.

VinylFox
23 Dec 2009, 4:48 AM
This bug was introduced in prototype-bridge.js rev 5252

Lines 42 - 45 from rev 5205 (previous version)

checkRelatedTarget = function(e) {
var related = Ext.lib.Event.getRelatedTarget(e);
return !(isXUL(related) || elContains(e.currentTarget,related));
};

Lines 21 - 23 from rev 5252

checkRelatedTarget = function(e) {
return !elContains(e.currentTarget, pub.getRelatedTarget(e));
};

Error: "pub is undefined"

Fix:

checkRelatedTarget = function(e) {
return !elContains(e.currentTarget, Ext.lib.Event.getRelatedTarget(e));
};

Anyone see any problems with that fix?

hendricd
23 Dec 2009, 6:15 AM
Nope, looks like the right way to go. ;)

Fixed in SVN.

VinylFox
24 Dec 2009, 5:40 AM
Thanks Doug.