Bug 27683: Bind results of GetAnalyticsCount to the EasyAnalyticalRecords pref
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 11 Feb 2021 14:33:35 +0000 (15:33 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 23 Aug 2022 19:38:42 +0000 (19:38 +0000)
commit28b5880d7113c98fd3ff336a3080a00781b9912d
treeb0b646c87b1ba913ef4fd73a3d319771a78ec72b
parent555efbd4470a6aba5bf18d1a6c05d7bc77381870
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dfc390940d8688195c5046f978f08bbd64bf24e1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Items.pm