If the prefs is updated, the fields won't be. To make sure we already fetch updated values, we should remove the package variable and define it in the subroutine.
Created attachment 51220 [details] [review] Bug 16443: Make C4::Members::Statistics plack safe If the prefs is updated, the fields won't be. To make sure we already fetch updated values, we should remove the package variable and define it in the subroutine. There is not test plan, just make sure the changes are consistent.
Created attachment 51322 [details] [review] Bug 16443: Make C4::Members::Statistics plack safe If the prefs is updated, the fields won't be. To make sure we already fetch updated values, we should remove the package variable and define it in the subroutine. There is not test plan, just make sure the changes are consistent. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This works, I haven't tested if there is a performance hit, but even if there was we need to make the change anyway. But if there is, we may want to put some caching in get_fields
(In reply to Chris Cormack from comment #3) > This works, I haven't tested if there is a performance hit, but even if > there was we need to make the change anyway. But if there is, we may want to > put some caching in get_fields Yes it is definitely slower. (You could speed up somewhat by returning to dbh, but we chose for DBIx..) Could we cache the item columns here instead of fetching them every time? get_fields needs the item columns and the pref.
(In reply to Marcel de Rooy from comment #4) > (In reply to Chris Cormack from comment #3) > > This works, I haven't tested if there is a performance hit, but even if > > there was we need to make the change anyway. But if there is, we may want to > > put some caching in get_fields > > Yes it is definitely slower. (You could speed up somewhat by returning to > dbh, but we chose for DBIx..) > Could we cache the item columns here instead of fetching them every time? > get_fields needs the item columns and the pref. Hm. Actually not too bad after all..
Created attachment 52219 [details] [review] Bug 16443: Make C4::Members::Statistics plack safe If the prefs is updated, the fields won't be. To make sure we already fetch updated values, we should remove the package variable and define it in the subroutine. There is not test plan, just make sure the changes are consistent. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 52220 [details] [review] Bug 16443: [QA Follow-up] Add two tests for get_fields Adds t/db_dependent/Members/Statistics.t. Test plan: Run the test. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for Koha 16.11, thanks Jonathan, Marcel!
Pushed in 16.05. Will be in 16.05.01.
Patches pushed to 3.22.x, will be in 3.22.8