Description
Jonathan Druart
2016-09-05 14:15:33 UTC
Created attachment 55176 [details] [review] Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s] This patch adds the 2 Koha::Object based classes for the marc_subfield_structure table Created attachment 55177 [details] [review] Bug 17249: Remove GetKohaAuthorisedValuesFromField - add tests This patch adds a few tests to C4::Record::marcrecord2csv The subroutine was not covered enough to validate that this patch set won't add regressions. Note that the patch set will fix an issue: If 2 subfields of a field are linked to AVs and you want to display them in a CSV, they won't be replaced with their descriptions. Test plan: Apply the patch, and make a copy of t/db_dependent/Record/marcrecord2csv.t Checkout master and prove marcrecord2csv.t Tests should fail Checkout the branch with the whole patch set applied The tests should pass Created attachment 55178 [details] [review] Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field This patch adds a new Koha::AuthorisedValues->search_by_marc_field method. It will permit to replace several subroutine from C4::Koha dealing with authorised values. It also uses this new methods to replace an occurrence of GetKohaAuthorisedValuesFromField in C4::Record::marcrecord2csv Test plan: prove t/db_dependent/AuthorisedValues.t should return green Created attachment 55179 [details] [review] Bug 17249: Remove GetKohaAuthorisedValuesFromField - inventory This patch deals with the inventory files calling GetKohaAuthorisedValuesFromField. Test plan: prove t/db_dependent/Items/GetItemsForInventory.t should still return green Use the inventory tool, on the result page the AV descriptions should correctly replace the codes Created attachment 55180 [details] [review] Bug 17249: Remove GetKohaAuthorisedValuesFromField - (follow-up) inventory Before this patch set, the tests in t/db_dependent/Items/GetItemsForInventory.t were executed in 4s. But with the previous patch, it was in 45sec(!) To make sure decrease this execution time to what it was before, this patch introduces a local to avoid the same query to be executed several times. Created attachment 55181 [details] [review] Bug 17249: Remove GetKohaAuthorisedValuesFromField Remove the subroutine, it's no longer in used. Test plan: git grep GetKohaAuthorisedValuesFromField should not return any occurrences. Created attachment 55182 [details] [review] Bug 17249: GetKohaAuthorisedValuesFromField - rm GetAuthValCodeFromField The subroutine GetAuthValCodeFromField was only used from GetKohaAuthorisedValuesFromField. Test plan: git grep GetAuthValCodeFromField should not return any occurrences. (In reply to Jonathan Druart from comment #5) > Created attachment 55180 [details] [review] [review] > To make sure decrease this execution time to what it was before, this > patch introduces a local to avoid the same query to be executed several > times. That does not mean anything... Read: To decrease this execution time to what it was before, this patch introduces a local cache not to execute the same query several times. patch does not apply CONFLICT (content): Merge conflict in t/db_dependent/AuthorisedValues.t Created attachment 55428 [details] [review] [SIGNED-OFF] Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s] This patch adds the 2 Koha::Object based classes for the marc_subfield_structure table Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 55429 [details] [review] [SIGNED-OFF] Bug 17249: Remove GetKohaAuthorisedValuesFromField - add tests This patch adds a few tests to C4::Record::marcrecord2csv The subroutine was not covered enough to validate that this patch set won't add regressions. Note that the patch set will fix an issue: If 2 subfields of a field are linked to AVs and you want to display them in a CSV, they won't be replaced with their descriptions. Test plan: Apply the patch, and make a copy of t/db_dependent/Record/marcrecord2csv.t Checkout master and prove marcrecord2csv.t Tests should fail Checkout the branch with the whole patch set applied The tests should pass Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 55430 [details] [review] [SIGNED-OFF] Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field This patch adds a new Koha::AuthorisedValues->search_by_marc_field method. It will permit to replace several subroutine from C4::Koha dealing with authorised values. It also uses this new methods to replace an occurrence of GetKohaAuthorisedValuesFromField in C4::Record::marcrecord2csv Test plan: prove t/db_dependent/AuthorisedValues.t should return green Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 55431 [details] [review] [SIGNED-OFF] Bug 17249: Remove GetKohaAuthorisedValuesFromField - inventory This patch deals with the inventory files calling GetKohaAuthorisedValuesFromField. Test plan: prove t/db_dependent/Items/GetItemsForInventory.t should still return green Use the inventory tool, on the result page the AV descriptions should correctly replace the codes Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 55432 [details] [review] [SIGNED-OFF] Bug 17249: Remove GetKohaAuthorisedValuesFromField - (follow-up) inventory Before this patch set, the tests in t/db_dependent/Items/GetItemsForInventory.t were executed in 4s. But with the previous patch, it was in 45sec(!) To make sure decrease this execution time to what it was before, this patch introduces a local to avoid the same query to be executed several times. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 55433 [details] [review] [SIGNED-OFF] Bug 17249: Remove GetKohaAuthorisedValuesFromField Remove the subroutine, it's no longer in used. Test plan: git grep GetKohaAuthorisedValuesFromField should not return any occurrences. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 55434 [details] [review] [SIGNED-OFF] Bug 17249: GetKohaAuthorisedValuesFromField - rm GetAuthValCodeFromField The subroutine GetAuthValCodeFromField was only used from GetKohaAuthorisedValuesFromField. Test plan: git grep GetAuthValCodeFromField should not return any occurrences. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Everything tested correctly according to the test plans. The only issue I had was that GetItemsForInventory.t was still very slow. I don't know if that was a problem with the patch or a problem with my slow VM. Created attachment 56380 [details] [review] [PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add classes MarcSubfieldStructure[s] This patch adds the 2 Koha::Object based classes for the marc_subfield_structure table Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 56381 [details] [review] [PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - add tests This patch adds a few tests to C4::Record::marcrecord2csv The subroutine was not covered enough to validate that this patch set won't add regressions. Note that the patch set will fix an issue: If 2 subfields of a field are linked to AVs and you want to display them in a CSV, they won't be replaced with their descriptions. Test plan: Apply the patch, and make a copy of t/db_dependent/Record/marcrecord2csv.t Checkout master and prove marcrecord2csv.t Tests should fail Checkout the branch with the whole patch set applied The tests should pass Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 56382 [details] [review] [PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field This patch adds a new Koha::AuthorisedValues->search_by_marc_field method. It will permit to replace several subroutine from C4::Koha dealing with authorised values. It also uses this new methods to replace an occurrence of GetKohaAuthorisedValuesFromField in C4::Record::marcrecord2csv Test plan: prove t/db_dependent/AuthorisedValues.t should return green Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 56383 [details] [review] [PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - inventory This patch deals with the inventory files calling GetKohaAuthorisedValuesFromField. Test plan: prove t/db_dependent/Items/GetItemsForInventory.t should still return green Use the inventory tool, on the result page the AV descriptions should correctly replace the codes Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 56384 [details] [review] [PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - (follow-up) inventory Before this patch set, the tests in t/db_dependent/Items/GetItemsForInventory.t were executed in 4s. But with the previous patch, it was in 45sec(!) To make sure decrease this execution time to what it was before, this patch introduces a local to avoid the same query to be executed several times. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 56385 [details] [review] [PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField Remove the subroutine, it's no longer in used. Test plan: git grep GetKohaAuthorisedValuesFromField should not return any occurrences. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 56386 [details] [review] [PASSED QA] Bug 17249: GetKohaAuthorisedValuesFromField - rm GetAuthValCodeFromField The subroutine GetAuthValCodeFromField was only used from GetKohaAuthorisedValuesFromField. Test plan: git grep GetAuthValCodeFromField should not return any occurrences. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Good clear refactoring, much clearer code. Thanks Jonathan Pushed to master for 16.11, thanks Jonathan! |