When searching the catalogue, if I get no results then hit the Z39.50 search the title field in the pop up window is populated with what I searched for. If I search for a valid ISBN number and hit the Z39.50 search, the title field is populated with the ISBN number I searched for. This number should populate the ISBN field and not the title field.
Created attachment 4528 [details] [review] Proposed Patch for this bug Patch file. Bug 6539: Creates a function to validate an isbn and uses it to populate the Z3950 search popup isbn with this value, the the value is not an isbn number the title field is populated. To Test: Perform a catalogue search then hit the Z39.50 search button and your search term should populate the Title field in the pop up window. Now perform a search on a valid ISBN (10 or 13) number and the term you searched for should populate the ISBN field on the popup window.
I wondered if this paragraph was deleted by accicdent, because it seems not related to the patch description: [...] - - # can place hold on item ? - if ((!$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems')) - && !$item->{itemlost} - && !$item->{withdrawn} - ) { - $can_place_holds = 1; - } - $other_count++; [...]
Ah yes it was deleted by accident. Well spotted. I'll revert it back in a new patch I'm releasing shortly, uses Business::ISBN rather than re-inventing the wheel. (In reply to comment #2) > I wondered if this paragraph was deleted by accicdent, because it seems not > related to the patch description: > > [...] > - > - # can place hold on item ? > - if ((!$item->{damaged} || > C4::Context->preference('AllowHoldsOnDamagedItems')) > - && !$item->{itemlost} > - && !$item->{withdrawn} > - ) { > - $can_place_holds = 1; > - } > - > $other_count++; > [...]
Created attachment 4529 [details] [review] Updated Patch File Z39.50 ISBN Field Populate Updated patch File: Now uses Business::ISBN to validate the ISBN and removes the user defined function validate_isbn()
Created attachment 4530 [details] [review] Updated Patch File Z39.50 ISBN Field Populate New patch based on a fresh git-clone
Hi Peter, thx for your work on this. I have one more concern: + my $bsth; + if ( C4::Context->preference("searchMyLibraryOnly") ) + { + $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches WHERE branchcode = '". C4::Branch::mybranch() ."' "); # FIXME : use C4::Branch::GetBranches + } + else + { + $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches "); + } This adds a check for a new system preference 'searchMyLibraryOnly' that is currently not existing in Koha (hope I didn't miss it). If this is something you want to contribute to Koha it should go on a different bug with more code to add the system preference properly and with a description what it is supposed to do, so that it can be documented.
Created attachment 4539 [details] [review] Updated Patch File Z39.50 ISBN Field Populate Modified SQL queries to use placeholders
Created attachment 4643 [details] [review] [SIGNED-OFF] When searching the catalogue, if I get no results then hit the Z39.50 search the title field in the pop up window is populated with what I searched for. If I search for a valid ISBN number and hit the Z39.50 search, the title field is populated with the ISBN number I searched for. This number should populate the ISBN field and not the title field. http://bugs.koha-community.org/show_bug.cgi?id=6539 Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> To test: - Search new ISBN using ISBN search from advanced search page - 0 results - click on Z39.50 search - Z30.50 form will have your ISBN in ISBN search option I am signing off on this, because it's an improvement over the current behaviour. I see some problems though that should perhaps be addressed in a separate bug or as a follow-up: If you use th catalog search field and search for an ISBN or a keyword the right fields of the Z39.50 search form will be populated, but the search index will be put in front: ISBN: kw,wrdl: 9783492251495 or Title: kw,wrdl: koha testing If you search for ISBN as keyword on the advanced search page, it will still populate the Title search.
Sorry for being long to QA, but I've to mark "failed QA" because there are many lines that are unrelated to the goal of the patch. Those lines should not harm, but I think they should be removed from the patch: For example : - my $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches"); # FIXME : use C4::Branch::GetBranches + my $bsth =$dbh->prepare("SELECT branchcode,branchname FROM branches "); - # item is withdrawn, lost, damaged, not for loan, reserved or in transit + # item is withdrawn, lost or damaged - - # can place hold on item ? + + # can place hold on item ? An many: + (empty line added)
Created attachment 7328 [details] [review] [Signed Off] Bug 6539 - When searching the catalogue, if I get no results then hit the Z39.50 search the title field in the pop up window is populated with what I searched for. If I search for a valid ISBN number and hit the Z39.50 search, the title field is populated with the ISBN number I searched for. This number should populate the ISBN field and not the title field. http://bugs.koha-community.org/show_bug.cgi?id=6539 Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> To test: - Search new ISBN using ISBN search from advanced search page - 0 results - click on Z39.50 search - Z30.50 form will have your ISBN in ISBN search option I am signing off on this, because it's an improvement over the current behaviour. I see some problems though that should perhaps be addressed in a separate bug or as a follow-up: If you use th catalog search field and search for an ISBN or a keyword the right fields of the Z39.50 search form will be populated, but the search index will be put in front: ISBN: kw,wrdl: 9783492251495 or Title: kw,wrdl: koha testing If you search for ISBN as keyword on the advanced search page, it will still populate the Title search. Signed-off-by: Liz Rea <wizzyrea@gmail.com>
I ought to add, that I cleaned up the patch per Paul's desire. Please QA again? I didn't touch the meat of it, only the whitespace/weird comment changes.
also, katrin - I think there's another bug in here - even without this patch you get the kw,wrdl thing on the z searches now. Hrmph. I thought maybe it was someting to do with this patch but when I went back to check the original functionality I found that the kw,wrdl thing was showing up even on master. Hrmph.
QA comment: * a minor mistake in indentation, i've added a follow-up before pushing, just with indentation fixed * small patch passed QA
Also, this getting pushed means Peter gets added to the history! YAY!
sorry, I thought he was already here. Patch to add him pushed
This fix was included in the 3.6.x branch prior to 3.6.4.