Bug 31517 - C4::Tags should use Koha::Tags objects instead of raw SQL
Summary: C4::Tags should use Koha::Tags objects instead of raw SQL
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Joonas Kylmälä
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-02 19:53 UTC by Joonas Kylmälä
Modified: 2023-12-28 20:42 UTC (History)
1 user (show)

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


Attachments
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses (2.77 KB, patch)
2022-09-02 20:48 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 31517: Remove unused get_tag function (2.05 KB, patch)
2022-09-02 20:48 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses (2.81 KB, patch)
2022-11-01 01:02 UTC, David Nind
Details | Diff | Splinter Review
Bug 31517: Remove unused get_tag function (2.10 KB, patch)
2022-11-01 01:02 UTC, David Nind
Details | Diff | Splinter Review
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses (2.87 KB, patch)
2022-11-02 22:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31517: Remove unused get_tag function (2.16 KB, patch)
2022-11-02 22:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31517: (QA follow-up) Fix indentation (2.82 KB, patch)
2022-11-02 22:29 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 Joonas Kylmälä 2022-09-02 19:53:23 UTC
C4::Tags module does currently a lot of raw SQL queries. We should use the Koha object methods for these instead (Koha::Tags and so on).
Comment 1 Joonas Kylmälä 2022-09-02 20:48:14 UTC
Created attachment 140187 [details] [review]
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses

To test:
 1) Create a few new tags to any biblio by visiting the biblio's detail
 page on OPAC
 2) The visit http://localhost:8080/cgi-bin/koha/opac-tags.pl and try
 deleting those tags.
Comment 2 Joonas Kylmälä 2022-09-02 20:48:18 UTC
Created attachment 140188 [details] [review]
Bug 31517: Remove unused get_tag function
Comment 3 Joonas Kylmälä 2022-09-02 20:50:06 UTC
Please ignore the following failure from the QA script:

> forbidden pattern: tab char (line 130)

C4/Tags.pl already uses tabs so it doesn't make sense to change format part of the file with spaces as it will look strange on editors.
Comment 4 David Nind 2022-11-01 01:02:34 UTC
Created attachment 142847 [details] [review]
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses

To test:
 1) Create a few new tags to any biblio by visiting the biblio's detail
 page on OPAC
 2) The visit http://localhost:8080/cgi-bin/koha/opac-tags.pl and try
 deleting those tags.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2022-11-01 01:02:38 UTC
Created attachment 142848 [details] [review]
Bug 31517: Remove unused get_tag function

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Katrin Fischer 2022-11-02 22:28:53 UTC
Created attachment 143046 [details] [review]
Bug 31517: Replace raw SQL queries in C4::Tags with Koha object accesses

To test:
 1) Create a few new tags to any biblio by visiting the biblio's detail
 page on OPAC
 2) The visit http://localhost:8080/cgi-bin/koha/opac-tags.pl and try
 deleting those tags.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2022-11-02 22:28:58 UTC
Created attachment 143047 [details] [review]
Bug 31517: Remove unused get_tag function

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2022-11-02 22:29:02 UTC
Created attachment 143048 [details] [review]
Bug 31517: (QA follow-up) Fix indentation

Also removes commented out Data::Dumper.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Tomás Cohen Arazi 2022-11-04 23:21:10 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!