I noticed that the renew feature under circulation does not check to see if the itemBarcodeInputFilter is being used. Adding the following line directly after it assigns the barcode variable fixes this issue. $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
Still valid in master.
Created attachment 86594 [details] [review] Bug 13763: Added check for filter syspref in renew.pl In Circulation->Renew, the renew feature does not check the system preference itemBarcodeFilter to see whether the barcode needs to be converted. This patch fixes this, adding a check for the system pref and applying it accordingly to convert the barcode if it is needed. Test plan: 1) In Circulation->Renew, enter a barcode that you know exists in the catalogue but add extra spaces, breaking up the barcode. Note that this fails with a warning that says 'No item matches this barcode' 2) In system Preferences, set the itemBarcodeFilter pref to Remove spaces and repeat step1. Note that the result is the same as in step 1 3) Apply the patch 4) Repeat step 1, and note that the filter removes the spaces and the item is renewed (or gives an error that indicates it recognises the barcode) Sponsored-by: Catalyst IT
After applying the patch, it is still invalid
(In reply to Bin from comment #4) > After applying the patch, it is still invalid Hi Bin, Can you please describe what you did, and what was the result?
(In reply to Hayley Mapley from comment #5) > (In reply to Bin from comment #4) > > After applying the patch, it is still invalid > > Hi Bin, > > Can you please describe what you did, and what was the result? I followed the test plan: Test plan: 1) In Circulation->Renew, enter a barcode that you know exists in the catalogue but add extra spaces, breaking up the barcode. Note that this fails with a warning that says 'No item matches this barcode' 2) In system Preferences, set the itemBarcodeFilter pref to Remove spaces and repeat step1. Note that the result is the same as in step 1 3) Apply the patch but still failed with a warning that said 'No item matches this barcode'
(In reply to Bin from comment #6) > (In reply to Hayley Mapley from comment #5) > > (In reply to Bin from comment #4) > > > After applying the patch, it is still invalid > > > > Hi Bin, > > > > Can you please describe what you did, and what was the result? > > I followed the test plan: > > Test plan: > 1) In Circulation->Renew, enter a barcode that you know exists in the > catalogue but add extra spaces, breaking up the barcode. Note that this > fails with a warning that says 'No item matches this barcode' > > 2) In system Preferences, set the itemBarcodeFilter pref to Remove > spaces and repeat step1. Note that the result is the same as in step 1 > > 3) Apply the patch > > but still failed with a warning that said 'No item matches this barcode' Thanks for testing! It still works for me, would you mind verifying that after applying the patch you restarted memcached and plack (I use restart_all) and that the barcode you are trying to test actually exists? For example, my test barcode was TEST11111 and I entered it as 'TE ST 11 111' with the system preference set to 'Remove spaces from'. This worked for me, I'm just trying to understand why it hasn't worked for you.
Sorry, I found that I made a wrong step in my understanding. There is no problem with the patch and test plan, which worked well!
Created attachment 86745 [details] [review] Bug 13763: Added check for filter syspref in renew.pl In Circulation->Renew, the renew feature does not check the system preference itemBarcodeFilter to see whether the barcode needs to be converted. This patch fixes this, adding a check for the system pref and applying it accordingly to convert the barcode if it is needed. Test plan: 1) In Circulation->Renew, enter a barcode that you know exists in the catalogue but add extra spaces, breaking up the barcode. Note that this fails with a warning that says 'No item matches this barcode' 2) In system Preferences, set the itemBarcodeInputFilter pref to Remove spaces and repeat step1. Note that the result is the same as in step 1 3) Apply the patch 4) Repeat step 1, and note that the filter removes the spaces and the item is renewed (or gives an error that indicates it recognises the barcode) Sponsored-by: Catalyst IT Signed-off-by: Bin Wen <bin.wen@inlibro.com>
(In reply to Bin from comment #9) > Created attachment 86745 [details] [review] [review] > Bug 13763: Added check for filter syspref in renew.pl > > In Circulation->Renew, the renew feature does not check the system > preference itemBarcodeFilter to see whether the barcode needs to be > converted. This patch fixes this, adding a check for the system pref and > applying it accordingly to convert the barcode if it is needed. > > Test plan: > 1) In Circulation->Renew, enter a barcode that you know exists in the > catalogue but add extra spaces, breaking up the barcode. Note that this > fails with a warning that says 'No item matches this barcode' > > 2) In system Preferences, set the itemBarcodeInputFilter pref to Remove > spaces and repeat step1. Note that the result is the same as in step 1 > > 3) Apply the patch > > 4) Repeat step 1, and note that the filter removes the spaces and the > item is renewed (or gives an error that indicates it recognises the > barcode) > > Sponsored-by: Catalyst IT > Signed-off-by: Bin Wen <bin.wen@inlibro.com> Thanks again for testing! I'll change the status to Signed Off so it'll get picked up by the QA team :)
Created attachment 86818 [details] [review] Bug 13763: Added check for filter syspref in renew.pl In Circulation->Renew, the renew feature does not check the system preference itemBarcodeFilter to see whether the barcode needs to be converted. This patch fixes this, adding a check for the system pref and applying it accordingly to convert the barcode if it is needed. Test plan: 1) In Circulation->Renew, enter a barcode that you know exists in the catalogue but add extra spaces, breaking up the barcode. Note that this fails with a warning that says 'No item matches this barcode' 2) In system Preferences, set the itemBarcodeInputFilter pref to Remove spaces and repeat step1. Note that the result is the same as in step 1 3) Apply the patch 4) Repeat step 1, and note that the filter removes the spaces and the item is renewed (or gives an error that indicates it recognises the barcode) Sponsored-by: Catalyst IT Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 86819 [details] [review] Bug 13763: (follow-up) Strip leading whitespace characters from input barcode this makes the work with barcodes from input consistant on checking out, checking in and renewing Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.04
backported to 18.05.x for 18.05.12