Refactor tag administration to use database services#3703
Refactor tag administration to use database services#3703demiankatz merged 14 commits intovufind-org:devfrom
Conversation
module/VuFind/src/VuFind/Db/Service/ResourceTagsServiceInterface.php
Outdated
Show resolved
Hide resolved
module/VuFind/src/VuFind/Db/Service/ResourceTagsServiceInterface.php
Outdated
Show resolved
Hide resolved
module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php
Outdated
Show resolved
Hide resolved
module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php
Outdated
Show resolved
Hide resolved
module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php
Outdated
Show resolved
Hide resolved
|
I've also pushed up Mink test coverage of the admin functionality to make this easier to test once I've merged it into #2233... once the full test suite passes in my test environment, I will merge this. |
|
@aleksip, running the full test suite actually revealed a long-standing problem that had not been noticed before: the admin tools were not cleaning up orphaned tags from the tags table; they were only deleting links. I've added a new database service method to clean this up, and integrated it with the admin tool. I thought about the possibility of a more automatic orphan cleanup tied in with other existing methods, but doing it more explicitly and in a granular fashion ultimately felt safer and clearer. However, since I've made a pretty significant change with this, I thought it best to re-request review before merging in case you have any thoughts about this. |
|
And just to confirm: the full test suite is now passing (it was failing before due to unexpected tags in the database during a later test). So as long as my new changes look okay, this should be all clear to merge. |
aleksip
left a comment
There was a problem hiding this comment.
LGTM! Sorry this took some time for me to review, I wanted to run the full tests and setting up a working test environment turned out to be more work than I expected.
This PR backports (and slightly improves/modifies) the tag administration port from #2233. The admin TagsController now exclusively uses database services instead of Laminas table/row classes.
One slightly controversial decision may be the use of a \Laminas\Paginator\Paginator as a return value from one of the ResourceTagsService methods, but since adapters exist for both Doctrine and Laminas database code into Laminas paginators, this seemed like a reasonably forward-compatible solution for pagination, at least for the moment.
It would also be a good idea to add Mink test coverage for this functionality, but I unfortunately do not currently have the available time. If time permits, I might work on that while I'm merging this into #2233.