[Bug 10522] New: Javascript error on acquisition pages: YAHOO is not defined
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Bug ID: 10522 Summary: Javascript error on acquisition pages: YAHOO is not defined Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: jonathan.druart@biblibre.com git bisect tells me that bug 9779 introduces a javascript issue in some acquisition pages. To reproduce: - open Firebug - go to acqui/addorderiso2709.pl I don't know if the guilty code in js/acq.js can be removed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |9779 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- I have a patch in progress for this already. I'll try to get it submitted today. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |7180 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 19342 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19342&action=edit Bug 10522 - Javascript error on acquisition pages: YAHOO is not defined acq.js includes an immediately invoked function expression, which means that it runs whether or not it is called. Because this function tries to reference the YAHOO object, it triggers an error on pages which don't include the main YAHOO assets. Only the basketgroups page uses this function and YAHOO assets. It's probably possible to make this a regular function, but I propose simply wrapping it in a check for the YAHOO object so that it only executes on pages where YAHOO exists--the basketgroups page. To test, apply the patch, clear your browser cache, and test on both the basketgroups page and at least one page which also includes acq.js (addorderiso2709.pl, neworderempty.pl, aqbudgets.pl, suggestion.pl, etc.) and confirm that the browser reports no JavaScript errors. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Don't you think it is worth to create, for instance a basketgroup.js, and to put this code in? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Jonathan Druart from comment #3)
Don't you think it is worth to create, for instance a basketgroup.js, and to put this code in?
That would certainly work. It would also work to replace the YUI-dependent JS with something that doesn't require YUI. I'm offering a minimal patch because I'm not familiar with how the basketgroups drag-and-drop JS works and would prefer that someone more familiar with acquisitions take it up. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19342|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19358 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19358&action=edit Bug 10522 - Javascript error on acquisition pages: YAHOO is not defined acq.js includes an immediately invoked function expression, which means that it runs whether or not it is called. Because this function tries to reference the YAHOO object, it triggers an error on pages which don't include the main YAHOO assets. Only the basketgroups page uses this function and YAHOO assets. It's probably possible to make this a regular function, but I propose simply wrapping it in a check for the YAHOO object so that it only executes on pages where YAHOO exists--the basketgroups page. To test, apply the patch, clear your browser cache, and test on both the basketgroups page and at least one page which also includes acq.js (addorderiso2709.pl, neworderempty.pl, aqbudgets.pl, suggestion.pl, etc.) and confirm that the browser reports no JavaScript errors. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> $ git show HEAD -w [...] - +if( typeof(YAHOO) === "object"){ (function() { var Dom = YAHOO.util.Dom; @@ -234,7 +234,7 @@ YAHOO.extend(DDList, YAHOO.util.DDProxy, { } }); })(); - +} -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |10533 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19358|0 |1 is obsolete| | --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 19449 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19449&action=edit Bug 10522 - Javascript error on acquisition pages: YAHOO is not defined acq.js includes an immediately invoked function expression, which means that it runs whether or not it is called. Because this function tries to reference the YAHOO object, it triggers an error on pages which don't include the main YAHOO assets. Only the basketgroups page uses this function and YAHOO assets. It's probably possible to make this a regular function, but I propose simply wrapping it in a check for the YAHOO object so that it only executes on pages where YAHOO exists--the basketgroups page. To test, apply the patch, clear your browser cache, and test on both the basketgroups page and at least one page which also includes acq.js (addorderiso2709.pl, neworderempty.pl, aqbudgets.pl, suggestion.pl, etc.) and confirm that the browser reports no JavaScript errors. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> $ git show HEAD -w [...] - +if( typeof(YAHOO) === "object"){ (function() { var Dom = YAHOO.util.Dom; @@ -234,7 +234,7 @@ YAHOO.extend(DDList, YAHOO.util.DDProxy, { } }); })(); - +} Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #7 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Owen! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10522 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10786 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org