C4::Items::GetAnalyticsCount is part of the easy analytics feature. Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled. Actually it may block an item deletion for wrong reason.
Created attachment 116767 [details] [review] Bug 27683: Unit test for GetAnalyticsCount Run prove t/db_dependent/Items/GetAnalyticsCount.t
Created attachment 116768 [details] [review] Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref C4::Items::GetAnalyticsCount is part of the easy analytics feature. Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled. Actually it may block an item deletion for wrong reason. Test plan : 1) Dont apply patch 2) Build an item and a linked analytical record with 773$0 and $9 3) Enable EasyAnalyticalRecords 4) Try to delete the item 5) You have an alert because linked to analytics 6) Disable EasyAnalyticalRecords 7) Try to delete the item 8) You have an alert because linked to analytics 9) Apply patch 10) Try to delete the item 11) No alert, it works :D
Created attachment 116769 [details] [review] Bug 27683: Impact on catalogue/detail.pl Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove test in catalogue/detail.pl. Test plan : 1) Build an item and a linked analytical record with 773$0 and $9 2) Go to record detail page 3) Enable EasyAnalyticalRecords 4) You see analytics tab and analytical count on item 5) Disable EasyAnalyticalRecords 6) You dont see analytics tab
Created attachment 127839 [details] [review] Bug 27683: Unit test for GetAnalyticsCount Run prove t/db_dependent/Items/GetAnalyticsCount.t
Created attachment 127840 [details] [review] Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref C4::Items::GetAnalyticsCount is part of the easy analytics feature. Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled. Actually it may block an item deletion for wrong reason. Test plan : 1) Dont apply patch 2) Build an item and a linked analytical record with 773$0 and $9 3) Enable EasyAnalyticalRecords 4) Try to delete the item 5) You have an alert because linked to analytics 6) Disable EasyAnalyticalRecords 7) Try to delete the item 8) You have an alert because linked to analytics 9) Apply patch 10) Try to delete the item 11) No alert, it works :D
Created attachment 127841 [details] [review] Bug 27683: Impact on catalogue/detail.pl Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove test in catalogue/detail.pl. Test plan : 1) Build an item and a linked analytical record with 773$0 and $9 2) Go to record detail page 3) Enable EasyAnalyticalRecords 4) You see analytics tab and analytical count on item 5) Disable EasyAnalyticalRecords 6) You dont see analytics tab
Created attachment 137447 [details] [review] Bug 27683: Unit test for GetAnalyticsCount Run prove t/db_dependent/Items/GetAnalyticsCount.t Signed-off-by: David Nind <david@davidnind.com>
Created attachment 137448 [details] [review] Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref C4::Items::GetAnalyticsCount is part of the easy analytics feature. Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled. Actually it may block an item deletion for wrong reason. Test plan : 1) Dont apply patch 2) Build an item and a linked analytical record with 773$0 and $9 3) Enable EasyAnalyticalRecords 4) Try to delete the item 5) You have an alert because linked to analytics 6) Disable EasyAnalyticalRecords 7) Try to delete the item 8) You have an alert because linked to analytics 9) Apply patch 10) Try to delete the item 11) No alert, it works :D Signed-off-by: David Nind <david@davidnind.com>
Created attachment 137449 [details] [review] Bug 27683: Impact on catalogue/detail.pl Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove test in catalogue/detail.pl. Test plan : 1) Build an item and a linked analytical record with 773$0 and $9 2) Go to record detail page 3) Enable EasyAnalyticalRecords 4) You see analytics tab and analytical count on item 5) Disable EasyAnalyticalRecords 6) You dont see analytics tab Signed-off-by: David Nind <david@davidnind.com>
Created attachment 137700 [details] [review] Bug 27683: Unit test for GetAnalyticsCount Run prove t/db_dependent/Items/GetAnalyticsCount.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 137701 [details] [review] Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref C4::Items::GetAnalyticsCount is part of the easy analytics feature. Like Bug 20702 make early return when the system preference EasyAnalyticalRecords is disabled. Actually it may block an item deletion for wrong reason. Test plan : 1) Dont apply patch 2) Build an item and a linked analytical record with 773$0 and $9 3) Enable EasyAnalyticalRecords 4) Try to delete the item 5) You have an alert because linked to analytics 6) Disable EasyAnalyticalRecords 7) Try to delete the item 8) You have an alert because linked to analytics 9) Apply patch 10) Try to delete the item 11) No alert, it works :D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 137702 [details] [review] Bug 27683: Impact on catalogue/detail.pl Since EasyAnalyticalRecords pref is now in GetAnalyticsCount, remove test in catalogue/detail.pl. Test plan : 1) Build an item and a linked analytical record with 773$0 and $9 2) Go to record detail page 3) Enable EasyAnalyticalRecords 4) You see analytics tab and analytical count on item 5) Disable EasyAnalyticalRecords 6) You dont see analytics tab Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Great to see these old routines getting a little love and cleanup, thanks Fridolin.. Tests added, tidy up works as expected.. history confirmed. Passing QA
Pushed to master for 22.11. Nice work everyone, thanks!
Greaaaaaate thanks to all. This was a huge performance issue for some cases.
Pleaaaaaaaaaase backport to 22.05 and 21.11.
Backported to 22.05.x for 22.05.05
thx pushed to 21.11.x for 21.11.12
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document, marking resolved.