Created attachment 175700 [details] [review] Bug 38751: Add tests prove t/db_dependent/Koha/ILL/Request.t
Created attachment 175701 [details] [review] Bug 38751: Update Standard ILL backend add_request Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually
Created attachment 175702 [details] [review] Bug 38751: Update ILL::Request->extended_attributes This updates the extended_attributes method to also act as setter. Additionally, it'll skip adding any attribute that result in error, preventing an ugly error 500. Test plan: 1) Enable ILLModule sys pref 2) Attempt to create the following openurl request through the OPAC: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?DOI=10.1001%2Fjama.2024.11146&atitle=Interventions%20for%20High%20Body%20Mass%20Index%20in%20Children%20and%20Adolescents%3A%20US%20Preventive%20Services%20Task%20Force%20Recommendation%20Statement.&aulast=Nicholson%2C%20Wanda%20K.&backend=FreeForm&cardnumber=53807898&date=20240716&genre=article&id=DOI%3A10.1001%2Fjama.2024.11146&issn=00987484&issue=3&method=create&opac=1&openurl=1 3) Notice it fails with a Duplicate ID error and the OPAC blows up. This is because Koha is trying to add the 'DOI' illrequestattribute twice and that is resulting in a duplicate ID 4) Apply patches, repeat test plan, notice the error no longer happens, the request is created correctly and all successful attribute have been added.
Created attachment 175703 [details] [review] Bug 38751: Update ILL::Request->extended_attributes This updates the extended_attributes method to also act as setter. Additionally, it'll skip adding any attribute that result in error, preventing an ugly error 500. Test plan: 1) Enable ILLModule sys pref 2) Attempt to create the following openurl request through the OPAC: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?DOI=10.1001%2Fjama.2024.11146&atitle=Interventions%20for%20High%20Body%20Mass%20Index%20in%20Children%20and%20Adolescents%3A%20US%20Preventive%20Services%20Task%20Force%20Recommendation%20Statement.&aulast=Nicholson%2C%20Wanda%20K.&backend=FreeForm&cardnumber=53807898&date=20240716&genre=article&id=DOI%3A10.1001%2Fjama.2024.11146&issn=00987484&issue=3&method=create&opac=1&openurl=1 3) Notice it fails with a Duplicate ID error and the OPAC blows up. This is because Koha is trying to add the 'DOI' illrequestattribute twice and that is resulting in a duplicate ID 4) Apply patches, repeat test plan, notice the error no longer happens, the request is created correctly and all successful attribute have been added.
Created attachment 175704 [details] [review] Bug 38751: Add tests prove t/db_dependent/Koha/ILL/Request.t
Created attachment 175705 [details] [review] Bug 38751: Update Standard ILL backend add_request Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually
Created attachment 175903 [details] [review] Bug 38751: Update ILL::Request->extended_attributes This updates the extended_attributes method to also act as setter. Additionally, it'll skip adding any attribute that result in error, preventing an ugly error 500. Test plan: 1) Enable ILLModule sys pref 2) Attempt to create the following openurl request through the OPAC: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?DOI=10.1001%2Fjama.2024.11146&atitle=Interventions%20for%20High%20Body%20Mass%20Index%20in%20Children%20and%20Adolescents%3A%20US%20Preventive%20Services%20Task%20Force%20Recommendation%20Statement.&aulast=Nicholson%2C%20Wanda%20K.&backend=FreeForm&cardnumber=53807898&date=20240716&genre=article&id=DOI%3A10.1001%2Fjama.2024.11146&issn=00987484&issue=3&method=create&opac=1&openurl=1 3) Notice it fails with a Duplicate ID error and the OPAC blows up. This is because Koha is trying to add the 'DOI' illrequestattribute twice and that is resulting in a duplicate ID 4) Apply patches, repeat test plan, notice the error no longer happens, the request is created correctly and all successful attribute have been added. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 175904 [details] [review] Bug 38751: Add tests prove t/db_dependent/Koha/ILL/Request.t Signed-off-by: David Nind <david@davidnind.com>
Created attachment 175905 [details] [review] Bug 38751: Update Standard ILL backend add_request Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually Signed-off-by: David Nind <david@davidnind.com>
Created attachment 176124 [details] [review] Bug 38751: Update Standard ILL backend migrate Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually The test plan in bug 38819 fails without this patch (page explodes with duplicate ID error). It's the same cause as the one being fixed here in bug 38751 so I'm submitting this here.
Created attachment 176250 [details] [review] Bug 38751: Update ILL::Request->extended_attributes This updates the extended_attributes method to also act as setter. Additionally, it'll skip adding any attribute that result in error, preventing an ugly error 500. Test plan: 1) Enable ILLModule sys pref 2) Attempt to create the following openurl request through the OPAC: http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?DOI=10.1001%2Fjama.2024.11146&atitle=Interventions%20for%20High%20Body%20Mass%20Index%20in%20Children%20and%20Adolescents%3A%20US%20Preventive%20Services%20Task%20Force%20Recommendation%20Statement.&aulast=Nicholson%2C%20Wanda%20K.&backend=FreeForm&cardnumber=53807898&date=20240716&genre=article&id=DOI%3A10.1001%2Fjama.2024.11146&issn=00987484&issue=3&method=create&opac=1&openurl=1 3) Notice it fails with a Duplicate ID error and the OPAC blows up. This is because Koha is trying to add the 'DOI' illrequestattribute twice and that is resulting in a duplicate ID 4) Apply patches, repeat test plan, notice the error no longer happens, the request is created correctly and all successful attribute have been added. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 176251 [details] [review] Bug 38751: Add tests prove t/db_dependent/Koha/ILL/Request.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 176252 [details] [review] Bug 38751: Update Standard ILL backend add_request Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 176253 [details] [review] Bug 38751: Update Standard ILL backend migrate Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually The test plan in bug 38819 fails without this patch (page explodes with duplicate ID error). It's the same cause as the one being fixed here in bug 38751 so I'm submitting this here. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Clear bugfix and code improvement, well tested and clear. QA scripts all happy, Passing QA
Pushed for 25.05! Well done everyone, thank you!