Wasted hours on this
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 7 Sep 2012 23:31:18 +0000 (19:31 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:07:00 +0000 (11:07 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/url_verify/select_urls.tt2
Open-ILS/web/js/dojo/openils/FlattenerStore.js
Open-ILS/web/js/dojo/openils/URLVerify/SelectURLs.js
Open-ILS/web/js/dojo/openils/URLVerify/nls/URLVerify.js

index c8d94ff..a44d563 100644 (file)
         jsid="grid"
         dojoType="openils.widget.FlattenerGrid"
         columnPersistKey='"url_verify.select_url"'
-        autoHeight="10"
         editOnEnter="false"
         autoCoreFields="true"
         autoCoreFieldsFilter="true"
         autoCoreFieldsUnsorted="true"
         fetchLock="true"
-        mapExtras="{session_id: {path: 'item.session.id', filter: true}}"
+        mapExtras="{session_id: {path: 'session.id', filter: true}}"
         showLoadFilter="true"
         fmClass="'uvu'">
         <thead>
                 <th field="isbn" fpath="item.target_biblio_record_entry.simple_record.isbn" _visible="false"></th>
                 <th field="issn" fpath="item.target_biblio_record_entry.simple_record.issn" _visible="false"></th>
                 <th field="bib_id" fpath="item.target_biblio_record_entry.id" _visible="false"></th>
-                <th field="verifications" fpath="verifications.id" ffilter="true">Verifications</th>
+                <!-- You do NOT want to add the "verifications" column to this
+                table with ffilter="true".  That introduces a left join to a
+                table linked to the core table in has-many relationship.  When
+                PCRUD tries a query like that, it can return fewer objects than
+                its LIMIT clause called for, even when there are more objects
+                left.  That should probably be a bug report, but we can just
+                avoid such situations for now. -->
             </tr>
         </thead>
     </table>
index 6f3f989..b7452f5 100644 (file)
@@ -182,7 +182,9 @@ if (!dojo._hasResource["openils.FlattenerStore"]) {
             if (!this.mapKey)
                 this._get_map_key();
 
-            return this._build_flattener_params(req);
+            var p = this._build_flattener_params(req);
+            console.debug("_fetch_prepare() returning " + dojo.toJson(p));
+            return p;
         },
 
         "_fetch_execute": function(params,handle_as,mime_type,onload,onerror) {
@@ -390,9 +392,17 @@ if (!dojo._hasResource["openils.FlattenerStore"]) {
                     else
                         might_be_a_lie += obj.length;
 
+                    console.debug(
+                        "process_fetch() calling onBegin with " +
+                        might_be_a_lie + ", " + dojo.toJson(req)
+                    );
                     req.onBegin.call(callback_scope, might_be_a_lie, req);
                 }
 
+                console.debug(
+                    "about to call onItem for " + obj.length +
+                    " elements in the obj array"
+                );
                 dojo.forEach(
                     obj,
                     function(item) {
@@ -404,8 +414,13 @@ if (!dojo._hasResource["openils.FlattenerStore"]) {
                     }
                 );
 
-                if (typeof req.onComplete == "function")
+                if (typeof req.onComplete == "function") {
+                    console.debug(
+                        "here goes onComplete, with " + obj + " and " +
+                        dojo.toJson(req)
+                    );
                     req.onComplete.call(callback_scope, obj, req);
+                }
             };
 
             var process_error = dojo.hitch(
index 3023937..bcea31a 100644 (file)
@@ -38,6 +38,11 @@ if (!dojo._hasResource["openils.URLVerify.SelectURLs"]) {
     module.verify_selected = function() {
         var really_everything = false;
 
+        if (module.grid.getSelectedItems().length < 1) {
+            alert(localeStrings.NOTHING_SELECTED);
+            return;
+        }
+
         if (module.grid.everythingSeemsSelected())
             really_everything = confirm(localeStrings.VERIFY_ALL);
 
index 2db8ca8..74f1b6a 100644 (file)
@@ -10,5 +10,6 @@
     "VERIFICATION_DIALOG": "Verifying URLs ...",
     "VERIFICATION_ATTEMPT_ID": "Verification attempt ID: ${0}",
     "VERIFICATION_ATTEMPT_START": "Attempt start time: ${0}",
-    "VERIFICATION_ATTEMPT_FINISH": "Attempt finish time: ${0}"
+    "VERIFICATION_ATTEMPT_FINISH": "Attempt finish time: ${0}",
+    "NOTHING_SELECTED": "No rows are selected, so no action will be taken."
 }