https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28371

--- Comment #4 from David Cook <[email protected]> ---
Comment on attachment 121111
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121111
Bug 28371: WIP

Review of attachment 121111:
 --> 
(https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=28371&attachment=121111)
-----------------------------------------------------------------

::: C4/XSLT.pm
@@ +40,4 @@
>  
>  my $engine; #XSLT Handler object
>  my %authval_per_framework;
> +my %authval_descs;

Are you sure about this scope? 

This will be for the life of the Starman worker, which could lead to stale data
and inconsistent results, if you're actively changing authorised value
descriptions.

Having a cache scoped to the request would be safer I think. I suppose a
"$cache" hashref passed to XSLTParse4Display and then on to
transformMARCXML4XSLT would do the trick.

@@ +91,5 @@
> +                        } else {
> +                            if( $av->{$tag}->{$letter} ){
> +                                my $orig_val = $value;
> +                                $value = GetAuthorisedValueDesc( $tag, 
> $letter, $value, '', $tagslib );
> +                                
> $authval_descs{$frameworkcode.$tag.$letter.$orig_val} = $value;

Sometimes, I wonder if we should just fetch all the authorised value
descriptions at the start. The pro is that you have a max of 1 database lookup.
The con is that you might be fetching a lot more data than you would if you
just end up needing 1 description. However, I haven't done any benchmarking on
the time of those pros and cons...

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to