LP1746360 Bib bucket 'Edition' display repair
authorBill Erickson <berickxx@gmail.com>
Mon, 4 Feb 2019 19:36:26 +0000 (14:36 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:49:28 +0000 (15:49 -0400)
Parse the JSON string value when fetching the metabib.wide_display_entry
data used to render the new Edition value.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index a9fa25e..110ace1 100644 (file)
@@ -533,6 +533,15 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
         setQuery : function(q) {
             if (q) query = q;
             return query;
+        },
+        itemRetrieved: function(item) {
+            // De-JSON-ify a wide display entry field.
+            // We don't use egBibDisplay.mwdeJSONToJS() since this
+            // is not a full "mwde" object.  Instead it's a single
+            // non-multi-field, JSON-encoded value.
+            item['biblio_record.wide_display_entry.edition'] =
+                JSON.parse(item['biblio_record.wide_display_entry.edition'])
+                || '';
         }
     };