Created attachment 93229 [details] [review] Bug 23696: take deleted biblios into account when building oai sets Test plan: 0) do not apply the patch 1) set up OAI and create at least one set 2) run build_oai_sets.pl 3) remember/write down number of records added 4) delete a biblio, the is included in set 5) run buid_oai_sets.pl again 6) the set is 1 record smaller 7) apply the patch 8) run build_oai_sets.pl 9) the number of record should be the same as in 3)
1
Created attachment 93334 [details] [review] Bug 23696: take deleted biblios into account when building oai sets Test plan: 0) do not apply the patch 1) set up OAI and create at least one set 2) run build_oai_sets.pl 3) remember/write down number of records added 4) delete a biblio, the is included in set 5) run buid_oai_sets.pl again 6) the set is 1 record smaller 7) apply the patch 8) run build_oai_sets.pl 9) the number of record should be the same as in 3) Signed-off-by: Michal Denar <black23@gmail.com>
This patch appears pretty straight-forward and it works for me, but I am having trouble with rerunning the script: 1) On running the script a second time, I get a lot of errors: DBD::mysql::st execute failed: Duplicate entry '50-1' for key 'PRIMARY' [for Statement " INSERT INTO oai_sets_biblios (set_id, biblionumber) VALUES (?,?) " with ParamValues: 0='1', 1=50] at /home/vagrant/kohaclone/C4/OAI/Sets.pm line 597. DBD::mysql::st execute failed: Duplicate entry '52-1' for key 'PRIMARY' [for Statement " INSERT INTO oai_sets_biblios (set_id, biblionumber) VALUES (?,?) " with ParamValues: 0='1', 1=52] at /home/vagrant/kohaclone/C4/OAI/Sets.pm line 597. 2) Also the links for Metadata and Set don't appear to work in our HTML representation of the OAI-Server: /cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=oai_dc&set=TEST 3) Even without the patch and after rerunning the script reporting 45 records (instead of the 46 it should have), I still can see a deleted record in the web output of the set. Can you please check these things and let me know? 3 might be related to this patch (blocker), the other 2 possibly separate bugs?
(In reply to Katrin Fischer from comment #4) > This patch appears pretty straight-forward and it works for me, but I am > having trouble with rerunning the script: > > 1) On running the script a second time, I get a lot of errors: > DBD::mysql::st execute failed: Duplicate entry '50-1' for key 'PRIMARY' [for > Statement " > INSERT INTO oai_sets_biblios (set_id, biblionumber) > VALUES (?,?) > " with ParamValues: 0='1', 1=50] at > /home/vagrant/kohaclone/C4/OAI/Sets.pm line 597. > DBD::mysql::st execute failed: Duplicate entry '52-1' for key 'PRIMARY' [for > Statement " > INSERT INTO oai_sets_biblios (set_id, biblionumber) > VALUES (?,?) > " with ParamValues: 0='1', 1=52] at > /home/vagrant/kohaclone/C4/OAI/Sets.pm line 597. Hi Katrin, thanks for testing! when you are running this script more than once, you need to add -r parameter - it will clean the table before generating it again. > > 2) Also the links for Metadata and Set don't appear to work in our HTML > representation of the OAI-Server: > > /cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=oai_dc&set=TEST Can you add more details to this question? > > 3) Even without the patch and after rerunning the script reporting 45 > records (instead of the 46 it should have), I still can see a deleted record > in the web output of the set. The access to records are not limited by set, you can use OAI without set parameter in Koha. And it is OK, because set is optional by standard: http://www.openarchives.org/OAI/openarchivesprotocol.html#Set
Created attachment 107275 [details] [review] Bug 23696: take deleted biblios into account when building oai sets Test plan: 0) do not apply the patch 1) set up OAI and create at least one set 2) run build_oai_sets.pl 3) remember/write down number of records added 4) delete a biblio, the is included in set 5) run buid_oai_sets.pl again 6) the set is 1 record smaller 7) apply the patch 8) run build_oai_sets.pl 9) the number of record should be the same as in 3) Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Patch on itself looks good to me. Passing QA. Watch bug 20271. Katrin's questions in comment4 apply to OAI in general. The functionality of OAI sets in Koha looks rather poor to me. The form where you create a set is not really intuitive. When I created a set, the rule was duplicated. I wanted a set with biblionumber < some value. This is not possible. I tried field 001, but I can only choose == or != which is useless. And I should add a subfield which is NOT there. Furthermore I am not convinced if we should really build a table like oai_set_biblios or do that on the fly. The latter looks better to me at first.
Pushed to master for 20.11, thanks to everybody involved!
small enchacement, choosing to backport to 20.05.x for 20.05.03
enhancement, not backported to 19.11.x