• Resolved beesan

    (@beesan)


    Thank you for the great plugin.

    From the following support topic, I understand that the Barcode field cannot have special characters

    WebLibrarian-special characters

    Unfortunately, the books in our library use barcodes with a hyphen in them.

    The only work around I can think of is removing the hyphen from the barcode string when uploading our books via csv to populate the book inventory. However, this means that the hyphen will have to be manually removed from the ‘Scanned Barcode’ field whenever a volunteer scans a book’s barcode for lookup while working the Circulation Desk.

    We already have more than two thousand items with barcodes already in place, so updating all the books with new barcodes is not really an option.

    Any suggestions as to the best way to work around the hyphen problem?

    Best regards,

    Rick

    https://www.ads-software.com/plugins/weblibrarian/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter beesan

    (@beesan)

    I’ve been doing some searching on how to sanitize form field input. One interesting tutorial is at the following page:

    PHP Tutorial: How to Sanitize Form Data

    If this type of function could be called to strip out the hyphen from the barcode lookup field when the form posts, that should solve the problem I have.

    I do not know how to create a php function do to this, but I was hoping there is some php code snippet that I can copy and paste into the Weblibrarian plugin files that would could implement this. (Perhaps there maybe some javascript functions that could also do this.)

    Any thoughts?

    Best regards,

    Rick

    Hello,

    It’s a quick and dirty fix but you can change the file WEBLIB_Circulation_Admin.php on line 376.

    Replace this line :
    $this->barcode = isset($_REQUEST['barcode']) ? $_REQUEST['barcode'] : '';

    By this :
    $this->barcode = isset($_REQUEST['barcode']) ? str_replace("-","",$_REQUEST['barcode']) : '';

    It will remove any hyphen present in the barcode field.

    See here for more information on this function : https://secure.php.net/manual/en/function.str-replace.php

    Regards.

    Thread Starter beesan

    (@beesan)

    Hi Banditu2B,

    Thank you for the advice.

    Your suggestion to modify the php code in WEBLIB_Circulation_Admin.php on line 376 works perfectly.

    Best regards,

    Rick

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hyphen in Barcode Field’ is closed to new replies.