[OPEN-ILS-DEV] ***SPAM*** RE: Boolean Search Feature Questions

Dan Reuther dReuther at catalystitservices.com
Tue Apr 1 18:41:24 EDT 2014


I'm sorry if it sounded like I was questioning the need to restart services -- I wasn't.

Part of the reason that I and others have been nudging you toward the list is so that others can either jump in to help, or learn from our discussion.  I'll try to be more explicit.

With that in mind, I'm all for automating repetitive tasks, but I want to make sure that both you and anyone following along at home doesn't get the impression that a full rebuild would be necessary for this sort of change.  For testing out a WIP patch that just touches the Perl, simply dropping the patch in place and restarting services (and, if mod_perl code is touched, apache) is enough.

I also apologize if I came off as defensive, I appreciate any guidance you provide, I find it extremely valuable.

That's a symptom, yes.  The ultimate cause is that method_lookup() can be called as a class method, so the invocant $self is a package name instead of an instance, but session() assumes it is being called as an instance method.  The class method is a legitimate use case, so I've restructured the patch a little to account for that, and to try to make sure that calling code gets everything it needs by unwrapping the subrequest in one case.

I have tried out this latest patch and OpenSRF will start now but I am still not getting the locale to propagate as expected.   Looking in OpenILS/WWW/EGCatLoader/Search.pm


434<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l434>
 435<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l435>             my $method = 'open-ils.search.biblio.multiclass.query';
436<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l436>             $method .= '.staff' if $ctx->{is_staff};
437<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l437>             $method =~ s/biblio/metabib/ if $is_meta;
438<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l438>
 439<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l439>             my $ses = OpenSRF::AppSession->create('open-ils.search');
440<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l440>
 441<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l441>             $self->timelog("Firing off the multiclass query");
442<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l442>             my $req = $ses->request($method, $args, $query, 1);
443<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l443>             $results = $req->gather(1);
444<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=3a69fb1937402bc0f5eecde6f149cce7fec0d59d;hb=HEAD#l444>             $self->timelog("Returned from the multiclass query");

I believe the call to OpenSRF on line 439 is what kicks this whole process off.  $ctx->{locale} is correct at this point, reflecting the settings selected on the web interface.   $ses->{session_locale}  is always en_US regardless.  Looking at the call I notice that the locale is never passed into OpenSRF.  Does this have to happen here? On a whim I did try this .. $ses->{session_locale}  = $ctx->{locale}    This has the effect of having the correct language setting propagate down into metabib.  Of course this still does not fix the issue so I am continuing to look.

That brings the question, where is this translation supposed to happen?  In the Query Parser?  I have not been able to locate the code that handles this task.

I have also found another issue, which may or may not be related to this.  


More information about the Open-ils-dev mailing list