[open-ils-commits] r8510 - branches/acq-experiment/Open-ILS/web/opac/skin/default/js

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 28 10:31:56 EST 2008


Author: erickson
Date: 2008-01-28 10:04:43 -0500 (Mon, 28 Jan 2008)
New Revision: 8510

Modified:
   branches/acq-experiment/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
protecting against edge case where we run off the end of the org table before finding a place to insert the callnumber row

Modified: branches/acq-experiment/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-01-28 15:03:32 UTC (rev 8509)
+++ branches/acq-experiment/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-01-28 15:04:43 UTC (rev 8510)
@@ -591,10 +591,13 @@
                 sib = rowNode.nextSibling;
                 o ='cp_info_'+thisOrg.id()+'_';
                 /* push the new row on as the last row for this org unit */
-                while( sib.id.match(o) ) {
+                while( sib && sib.id.match(o) ) {
                     sib = sib.nextSibling;
                 }
-				rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+                if(sib)
+				    rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+                else
+                    rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
             } else {
 				rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
             }



More information about the open-ils-commits mailing list