Bug 20615 - Add the link of number of times the authority are used in edit mode
Summary: Add the link of number of times the authority are used in edit mode
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: George Veranis
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 18:59 UTC by Patrick Robitaille
Modified: 2023-12-28 20:42 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00


Attachments
The screenshot shows that on edit mode it has the number of records are connected to the authority record (65.34 KB, image/png)
2022-01-07 23:32 UTC, George Veranis
Details
Authority edit page (37.56 KB, image/png)
2022-01-11 13:34 UTC, Patrick Robitaille
Details
Bug 20615: Add the link of number of times the authority are used in edit mode (3.17 KB, patch)
2022-02-24 15:47 UTC, George Veranis
Details | Diff | Splinter Review
Bug 20615: Add the link of number of times the authority are used in edit mode (3.24 KB, patch)
2022-02-28 18:20 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 20615: Add the link of number of times the authority are used in edit mode (3.23 KB, patch)
2022-04-28 12:13 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20615: Add the link of number of times the authority are used in edit mode (3.23 KB, patch)
2022-04-28 12:32 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Robitaille 2018-04-18 18:59:07 UTC
Hi, 

in the authorities module, when we consult a record there is a line at the top of the page indicating the number of records for which this authority is being usaed in. But this line disappears when you go into edit mode of the record. It would be convenient to keep this information on edit mode too. 

Thanks, Patrick.
Comment 1 George Veranis 2022-01-07 23:30:08 UTC
Hi Patrick, 

That you asked as a bug it seems that on the latest version of Koha has already be done.
Comment 2 George Veranis 2022-01-07 23:32:08 UTC
Created attachment 129207 [details]
The screenshot shows that on edit mode it has the number of records are connected to the authority record
Comment 3 Patrick Robitaille 2022-01-10 20:02:48 UTC
Hello,

My need is to see this information in the edit mode page also not just in the authority details page.

Thanks, Patrick.
Comment 4 George Veranis 2022-01-10 20:47:04 UTC
Hi Patrick, 

On edit mode of an authority as you can check also at the attached screenshot already exist . Can you please provide me more explanation , or maybe a screenshot , where you expect to have that info that you need ?
Comment 5 Patrick Robitaille 2022-01-11 13:32:01 UTC
Hi,

In the screenshot you added, you are at the authority details page. Here you can see the number of notices attached. What I would like is that when we click on 'Edit' and switch to the authority's edit page to also have this information that shows the number of records attached on that page.

Is it clearer to you?

I added a screenshot to this task

Thanks, Patrick.
Comment 6 Patrick Robitaille 2022-01-11 13:34:01 UTC
Created attachment 129294 [details]
Authority edit page
Comment 7 George Veranis 2022-01-11 13:48:11 UTC
Yes, now is more clear , sorry to not understand it earlier !
Comment 8 George Veranis 2022-02-24 15:47:39 UTC
Created attachment 131065 [details] [review]
Bug 20615: Add the link of number of times the authority are used in edit mode

Currently when show an authority record you can see the count of records linked
with that authority, but when edit that authority record the that detail is
dissapeared.
Applying this patch will have that information also on edit mode of authority.

Test plan:
1) Search for an authority that is already connected with at least one record
2) On detail view of an authority you can check that authority is linked with
   x records.
3) Edit that authority and the information about in how many records that
   authority is linked is missing.
4) Apply this patch
5) Edit again that authrity and you can find now the count in how many records
   is used that authority
Comment 9 ByWater Sandboxes 2022-02-28 18:20:36 UTC
Created attachment 131171 [details] [review]
Bug 20615: Add the link of number of times the authority are used in edit mode

Currently when show an authority record you can see the count of records linked
with that authority, but when edit that authority record the that detail is
dissapeared.
Applying this patch will have that information also on edit mode of authority.

Test plan:
1) Search for an authority that is already connected with at least one record
2) On detail view of an authority you can check that authority is linked with
   x records.
3) Edit that authority and the information about in how many records that
   authority is linked is missing.
4) Apply this patch
5) Edit again that authrity and you can find now the count in how many records
   is used that authority

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca>
Comment 10 Aleisha Amohia 2022-04-21 04:30:21 UTC
Looks like this was signed off so adjusting bug status.
Comment 11 Katrin Fischer 2022-04-28 11:50:44 UTC
(In reply to Aleisha Amohia from comment #10)
> Looks like this was signed off so adjusting bug status.

Thanks, Aleisha!
Comment 12 Katrin Fischer 2022-04-28 12:12:47 UTC
I've changed the patch author for 
root <root@vmi538303.contaboserver.net>
to 
George Veranis <gveranis@dataly.gr>
and reattached the patch.

The problem here is bug 30641 which I think makes this require another follow-up.

The code was taken from the detail page, which shows the wrong number of linked authorities.

I wonder if Koha::Authorities->find($authid); doesn't do an exact search?
Comment 13 Katrin Fischer 2022-04-28 12:13:25 UTC
Created attachment 134226 [details] [review]
Bug 20615: Add the link of number of times the authority are used in edit mode

Currently when show an authority record you can see the count of records linked
with that authority, but when edit that authority record the that detail is
dissapeared.
Applying this patch will have that information also on edit mode of authority.

Test plan:
1) Search for an authority that is already connected with at least one record
2) On detail view of an authority you can check that authority is linked with
   x records.
3) Edit that authority and the information about in how many records that
   authority is linked is missing.
4) Apply this patch
5) Edit again that authrity and you can find now the count in how many records
   is used that authority

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca>
Comment 14 Katrin Fischer 2022-04-28 12:18:41 UTC
> I wonder if Koha::Authorities->find($authid); doesn't do an exact search?
That's wrong. It's using:

get_usage_count

So we'd need to look there.
Comment 15 Katrin Fischer 2022-04-28 12:31:50 UTC
Ok, I have investigated a bit more. The wrong count is due to how we handle things in get_usage_count and it only happens when Elasticsearch is used in combination with QueryAutoTruncate = ON. We will need to fix get_usage_count, but we should do this separately.

Willing to pass this as is.
Comment 16 Katrin Fischer 2022-04-28 12:32:49 UTC
Created attachment 134249 [details] [review]
Bug 20615: Add the link of number of times the authority are used in edit mode

Currently when show an authority record you can see the count of records linked
with that authority, but when edit that authority record the that detail is
dissapeared.
Applying this patch will have that information also on edit mode of authority.

Test plan:
1) Search for an authority that is already connected with at least one record
2) On detail view of an authority you can check that authority is linked with
   x records.
3) Edit that authority and the information about in how many records that
   authority is linked is missing.
4) Apply this patch
5) Edit again that authrity and you can find now the count in how many records
   is used that authority

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca>
Comment 17 Fridolin Somers 2022-05-11 01:18:32 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄