From 54a65a24851adb62a40efa0bf42d597c72df4e57 Mon Sep 17 00:00:00 2001
From: Hammat Wele <hammat.wele@inlibro.com>
Date: Wed, 12 Jun 2024 21:57:53 +0000
Subject: [PATCH] Bug 27428: (follow-up) show the number instead [[object
 Object]], move OPACDisplayRecordCount to the 'Features' section

---
 .../modules/admin/preferences/searching.pref   | 18 +++++++++---------
 .../bootstrap/js/opac-display-record-count.js  |  6 ++++--
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
index 6d3b3e8141..bd75f0762f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
@@ -99,6 +99,14 @@ Searching:
             - "List of search fields (separated by | or ,) that should not be autotruncated by Elasticsearch even if <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=QueryAutoTruncate'>QueryAutoTruncate</a> is set to 'Yes':"
             - pref: ESPreventAutoTruncate
               class: long
+        -
+            - pref: OPACDisplayRecordCount
+              type: boolean
+              default: 0
+              choices:
+                  1: Show
+                  0: "Don't show"
+            - the number of records next to search links in the bibliographic record detail page in the OPAC.
     Search form:
         -
             - pref: LoadSearchHistoryToTheFirstLoggedUser
@@ -356,12 +364,4 @@ Searching:
             - LIBRIS base URL
             - pref: LibrisURL
               class: url
-            - "Please only change this if you are sure it needs changing."
-        -
-            - pref: OPACDisplayRecordCount
-              type: boolean
-              default: 0
-              choices:
-                  1: Show
-                  0: "Don't show"
-            - the number of records next to search links in the bibliographic record detail page in the OPAC.
\ No newline at end of file
+            - "Please only change this if you are sure it needs changing."
\ No newline at end of file
diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/opac-display-record-count.js b/koha-tmpl/opac-tmpl/bootstrap/js/opac-display-record-count.js
index efefb4b2fc..3e41dfb400 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/js/opac-display-record-count.js
+++ b/koha-tmpl/opac-tmpl/bootstrap/js/opac-display-record-count.js
@@ -7,7 +7,9 @@ var es_builder = {
     'Provider' : 'provider',
     'se,phr' : 'title-series',
     'au' : 'author',
-    'su,complete-subfield' : 'subject'
+    'su,complete-subfield' : 'subject',
+    'su' : 'subject',
+    'copydate': 'copydate',
 }
 var not_symbols = {
     '\'':'%27',
@@ -63,7 +65,7 @@ function NumberResultsRecord(){
     url: url_request + JSON.stringify(json_data) + '&key=' + key_display,
     success: function (data) {
         jQuery.each( all_link, function( i, val ) {
-            $(val).after("&nbsp;<span style=\"color:black\"><b>["+data[i]+"]</b></span>");
+            $(val).after("&nbsp;<span style=\"color:black\"><b>["+data[i].value+"]</b></span>");
         });
     },
     error: function (data) {
-- 
2.34.1