CARLI / web-reports

Web Reports Web Based Reporting Tool
2 stars 0 forks source link

Report "Item barcodes with invalid length report fails" F2 with unicode error in UIU #54

Open patrickzurek opened 8 years ago

patrickzurek commented 8 years ago

The report in the subject located in local_catalog_maintenance/item_records/barcodes fails to run for UIU with the message DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x8a in position 0: invalid start byte

patrickzurek commented 8 years ago

This report is working now. Jessica, can you verify the results?

gibsonjc commented 8 years ago

I've waited almost an hour and this one is still Pending for UIU on devel for me.
Pending Item Barcodes with Invalid Length Pending Pending Jun. 15, 2016, 12:12 PM 461475c3

The results came back very quickly in Access: 7326 results

I'll check on it again later. Going to move on to some other work.

gibsonjc commented 8 years ago

I guess it never finished; it has disappeared from my list now.

patrickzurek commented 8 years ago

I got a result right away just now. Maybe it's related to that other report that Chris identified that on first run finishes quickly, but on subsequent runs it is very slow.

What institution did you try it under? I can try it there with dbread and see if I can replicate it.

gibsonjc commented 8 years ago

I ran it Wednesday 6/15 in UIUdb because that is the one that it says it failed in according to your original report.

I just ran it in KNXdb and it ran to completion quickly and gave results: 6534. (same as Access) I just started it again for UIUdb and it is sitting Pending again. (I expect 7326 according to Access)

(UIU) Pending Item Barcodes with Invalid Length Pending Pending Jun. 17, 2016, 03:43 PM 7a638e66 (KNX) CSV Item Barcodes with Invalid Length None 6534 Jun. 17, 2016, 03:43 PM 1198fcc3

gibsonjc commented 6 years ago

Rechecked today on web-reports-devel. It ran to completion in KNX; still stuck at Pending in UIU.

Also, this report needs to offer an input box where a library can input the number of digits of their Item barcodes. It seems to be hard-coded at 14, which will will work for most but not all libraries.

gibsonjc commented 5 years ago

In DEVEL, this ran fine and to completion in a variety of databases: KNX, SIC, EIU, NIU, ISU, ISL, WIU, NBY It stuck in Pending in UIU and UIC. I'm not sure if this is because they are so big or some other reason.

If this could be changed slightly to provide an input box for the number of digits expected in the barcode (instead of hard-coded to 14), I think we could then release it with a caveat note that it will not work for UIC and UIU and they should run the report in Access instead.

gibsonjc commented 5 years ago

This one still runs fine on some databases but not others. It ran successfully for KNX, NCC, and SIC, but is stuck in Pending for UIU. I did some digging and realized that it was hanging up in UIU on some nasty unicode characters that shouldn't be there in the text of the ITEM_ENUM field. I fixed several manually in Voyager Cataloging, but they keep coming and interrupting the report. Since these nasty characters are also apparently a problem for UIC as well, and since we aren't going to be able to redesign Web Reports to handle them at this point without a developer, I think we could make this query usable if we take out the ITEM_ENUM and CHRON fields altogether from the output. As such, I propose the following changes:

  1. Remove the hard-coded 14 digit length and add a prompt to the user to enter the length of barcode appropriate to their library

  2. Remove ITEM_ENUM and CHRON fields from the output

  3. Optionally, add in the Title from the Bib (maybe from TITLE_BRIEF in BIB_TEXT linked via BIB_ITEM?*)

Users can easily copy and paste the barcode from the output to call up the item record in Voyager and there they will see the rest of the Item Enum and Chron data.

@csaundrs , are these edits something you could take a shot at?

*Here is some basic Access SQL that has ITEM_ENUM and ITEM_CHRON removed and the Title added:

SELECT ITEM_BARCODE.ITEM_BARCODE, LOCATION.LOCATION_CODE, ITEM.COPY_NUMBER, utf8to16([mfhd_master].[DISPLAY_CALL_NO]) AS Display_Call_No, BIB_TEXT.TITLE_BRIEF FROM (((((ITEM_BARCODE INNER JOIN ITEM ON ITEM_BARCODE.ITEM_ID = ITEM.ITEM_ID) INNER JOIN MFHD_ITEM ON ITEM.ITEM_ID = MFHD_ITEM.ITEM_ID) INNER JOIN MFHD_MASTER ON MFHD_ITEM.MFHD_ID = MFHD_MASTER.MFHD_ID) INNER JOIN LOCATION ON MFHD_MASTER.LOCATION_ID = LOCATION.LOCATION_ID) INNER JOIN BIB_ITEM ON ITEM.ITEM_ID = BIB_ITEM.ITEM_ID) INNER JOIN BIB_TEXT ON BIB_ITEM.BIB_ID = BIB_TEXT.BIB_ID WHERE (((Len([ITEM_BARCODE]))<>Val([Enter correct item barcode length]))) ORDER BY LOCATION.LOCATION_CODE, utf8to16([mfhd_master].[DISPLAY_CALL_NO]);

csaundrs commented 5 years ago

I made the recommended changes. It seems to work just fine, but on UIU, it acts as if it's going to return results....it just never does. Not sure what is going on with that.