From dd1a08f874eb5775249d553cf7093e86f1063ce9 Mon Sep 17 00:00:00 2001
From: Chris Hallberg <crhallberg@gmail.com>
Date: Mon, 15 Feb 2016 13:41:45 -0500
Subject: [PATCH] Fix index skipping problem with new checkSaveStatuses.

---
 module/VuFind/src/VuFind/Controller/AjaxController.php | 6 +-----
 themes/bootstrap3/js/check_save_statuses.js            | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/module/VuFind/src/VuFind/Controller/AjaxController.php b/module/VuFind/src/VuFind/Controller/AjaxController.php
index 29d68084e13..72ef9fbe439 100644
--- a/module/VuFind/src/VuFind/Controller/AjaxController.php
+++ b/module/VuFind/src/VuFind/Controller/AjaxController.php
@@ -502,12 +502,8 @@ class AjaxController extends AbstractBase
                 // if this item was saved, add it to the list of saved items.
                 foreach ($data as $list) {
                     $result[$i][] = [
-                        'record_id' => $id,
-                        'record_source' => $source,
-                        'resource_id' => $list->id,
                         'list_id' => $list->list_id,
-                        'list_title' => $list->list_title,
-                        'record_number' => $i
+                        'list_title' => $list->list_title
                     ];
                 }
             }
diff --git a/themes/bootstrap3/js/check_save_statuses.js b/themes/bootstrap3/js/check_save_statuses.js
index 9f010ecf2db..b9b6e3e1f7b 100644
--- a/themes/bootstrap3/js/check_save_statuses.js
+++ b/themes/bootstrap3/js/check_save_statuses.js
@@ -21,7 +21,7 @@ function checkSaveStatuses() {
       data: {id:ids, 'source':srcs},
       success: function(response) {
         if(response.status == 'OK') {
-          for (var rn=0; rn<response.data.length; rn++) {
+          for (var rn in response.data) {
             var list = $('#result'+rn).find('.savedLists')
             var html = list.find('strong')[0].outerHTML+'<ul>';
             for (var i=0; i<response.data[rn].length; i++) {
-- 
GitLab