The cataloguing statistics wizard offers a filter on publication year. For a MARC21 installation this filter won't ever work, because MARC21 maps the publication year internally to copyrightdate instead of publicationyear like UNIMARC. To test (in a MARC21 database): - Reports > Statistics wizards > Catalog - Check publication year and another column - Verify that publication year is NULL and the report is only one line
Created attachment 33442 [details] [review] Bug 12567: Make catalog statistics wizard publication year work for MARC21 Publication year was useless for MARC21, as it was using the biblioitems.publicationyear (UNIMARC) instead of biblio.copyrightdate (MARC21). This patch tries to fix the search options to work for both MARC flavours. To test: In Reports > Statistics wizards > Catalog: - Test the publication year search options on a UNIMARC and a MARC21 installation. - Make sure search results make sense for both.
Please test well!
Looks good to me... though your patches are full of tabs cait ;)
Created attachment 33453 [details] [review] [Signed Off] Bug 12567: Make catalog statistics wizard publication year work for MARC21 Publication year was useless for MARC21, as it was using the biblioitems.publicationyear (UNIMARC) instead of biblio.copyrightdate (MARC21). This patch tries to fix the search options to work for both MARC flavours. To test: In Reports > Statistics wizards > Catalog: - Test the publication year search options on a UNIMARC and a MARC21 installation. - Make sure search results make sense for both. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works well for me, fixed tab issues and signed off.
The search results do not make sense to me. Without the patch, I have one row with 0 results. OK (wrong index) With the patch, I have a lot of years with all 0 results. (I look for 1900 to 1902 e.g. and I get years between 1807 and 1990 but all zero, including 1902 that should have two results.) Failed QA
Hi Marcel, did you compare if the results are different than to UNIMARC? Could you share which filters you checked for your search?
And did you compare it to a UNIMARC result set for the same filters? I agree that something in this report is a bit weird, but I had good and working examples for both flavours in testing, I think it depends on the filters you select - if you limit the search further down, the results are weird before and after (for example a branchcode limit being in effect can make a difference)
Will have a look soon.
This script really needs further attention: If I do not select a field for row or column, the sql in sub calculate just crashes.
If I am filtering on itemtype and publication year, just having two books in that specific type, I have lots of pubyears. Not related to this patch, but this code is bad.
Created attachment 33986 [details] [review] Bug 12567: Make catalog statistics wizard publication year work for MARC21 Publication year was useless for MARC21, as it was using the biblioitems.publicationyear (UNIMARC) instead of biblio.copyrightdate (MARC21). This patch tries to fix the search options to work for both MARC flavours. To test: In Reports > Statistics wizards > Catalog: - Test the publication year search options on a UNIMARC and a MARC21 installation. - Make sure search results make sense for both. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> The changes are fine with me, but this script is certainly not bug free. Also note that all its SQL should be moved out according to our coding guidelines. When doing so, a rewrite would be appropriate.
Hi Marcel, I think we can agree the code is bad - but I think I don't have the skill to completely fix it :(
Patch pushed to master. Thanks Katrin!
Pushed to 3.18.x will be in 3.18.01