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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
);
}
-
-our $fields = get_fields();
-
-
=head2 get_fields
Get fields form syspref 'StatisticsFields'
Returns list of valid fields, defaults to 'location|itype|ccode'
sub construct_query {
my $count = shift;
my $subquery = shift;
+ my $fields = get_fields();
my @select_fields = split '\|', $fields;
my $query = "SELECT COUNT(*) as count_$count,";
$query .= join ',', @select_fields;