[Bug 23770] New: Add Koha::Object(s)->to_api method
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Bug ID: 23770 Summary: Add Koha::Object(s)->to_api method Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Given how the API codebase is growing and the plans we have to incorporate HAL representations, we need to allow the Koha::Object-based classes to be able to render themselves, so we can think of recursive structures embedding others in a generic way (i.e. not manually crafting things). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 93831 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93831&action=edit Bug 23770: Add Koha::Object(s)->to_api method Generic method that changes the attribute names of an object in the presence of the to_api_mapping method. It otherwise falls back to returning the TO_JSON output. This is WIP submitted early for scrutiny. Tests and example usage in an API controller coming. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |josef.moravec@gmail.com, | |m.de.rooy@rijksmuseum.nl, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agustinmoyano@theke.io -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #2 from Josef Moravec <josef.moravec@gmail.com> --- +1 Thanks Tomás. I do think that's the way we should go. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff CC| |tomascohen@gmail.com Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93831|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Josef Moravec from comment #2)
+1
Thanks Tomás.
I do think that's the way we should go.
Thanks for the feedback! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 93881 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93881&action=edit Bug 23770: Add Koha::Object(s)->to_api method Generic method that changes the attribute names of an object in the presence of the to_api_mapping method. It otherwise falls back to returning the TO_JSON output. This is WIP submitted early for scrutiny. Tests and example usage in an API controller coming. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 93882 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93882&action=edit Bug 23770: Add to_api_mapping method to Koha::City Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 93883 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93883&action=edit Bug 23770: Unit tests This patch introduces tests for the new to_api method introduced in Koha::Object(s). It uses Koha::City as a sample for simplicity. And it also uses Koha::Illrequests to test the case in which there's no to_api_mapping method defined on the class, to highlight that a fallback to calling TO_JSON is done. [1] [1] This is done under the assumption Illrequests controller code doesn't use any kind of mapping as the rest of the API controllers do, so there's little chance it would be added in a future. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t \ t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 93888 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93888&action=edit Bug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 93890 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93890&action=edit Bug 23770: (follow-up) Use ->to_api in /cities This patch aims to prove the behaviour does not differ. So you can run the tests for the endpoints, and the behaviour remains. The mappings and methods cannot be removed until $c->objects->search is fixed to make use of them as well. That will happen once all used Koha::Object-based classes implement the mappings. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/cities.t => SUCCESS: Tests pass! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93881|0 |1 is obsolete| | --- Comment #9 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 93891 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93891&action=edit Bug 23770: Add Koha::Object(s)->to_api method Generic method that changes the attribute names of an object in the presence of the to_api_mapping method. It otherwise falls back to returning the TO_JSON output. This is WIP submitted early for scrutiny. Tests and example usage in an API controller coming. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93882|0 |1 is obsolete| | --- Comment #10 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 93892 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93892&action=edit Bug 23770: Add to_api_mapping method to Koha::City Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93883|0 |1 is obsolete| | --- Comment #11 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 93893 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93893&action=edit Bug 23770: Unit tests This patch introduces tests for the new to_api method introduced in Koha::Object(s). It uses Koha::City as a sample for simplicity. And it also uses Koha::Illrequests to test the case in which there's no to_api_mapping method defined on the class, to highlight that a fallback to calling TO_JSON is done. [1] [1] This is done under the assumption Illrequests controller code doesn't use any kind of mapping as the rest of the API controllers do, so there's little chance it would be added in a future. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t \ t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Sponsored-by: ByWater Solutions Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93888|0 |1 is obsolete| | --- Comment #12 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 93894 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93894&action=edit Bug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93890|0 |1 is obsolete| | --- Comment #13 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 93895 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93895&action=edit Bug 23770: (follow-up) Use ->to_api in /cities This patch aims to prove the behaviour does not differ. So you can run the tests for the endpoints, and the behaviour remains. The mappings and methods cannot be removed until $c->objects->search is fixed to make use of them as well. That will happen once all used Koha::Object-based classes implement the mappings. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/cities.t => SUCCESS: Tests pass! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |BLOCKED --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- QAing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Depending on strict mode I have two results of the Object.t test: not ok 1 - Exception thrown correctly # Failed test 'Exception thrown correctly' # at t/db_dependent/Koha/Object.t line 411. # expecting: Koha::Exceptions::Object::BadValue # found: normal exit # Looks like you failed 1 test of 1. not ok 16 - Bad value tests # Failed test 'Exception thrown correctly' # at t/db_dependent/Koha/Object.t line 411. # expecting: Koha::Exceptions::Object::BadValue # found: DBIx::Class::Exception (DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect datetime value: 'wrong_value' for column `koha_master`.`borrowers`.`lastseen` at row 1 at /usr/share/koha/Koha/Object.pm line 156 # ) # Looks like you failed 1 test of 1. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Somehow does not meet: elsif( $_->{msg} =~ /Incorrect (?<type>\w+) value: '(?<value>.*)' for column '(?<property>\w+)'/ ) { -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Looks great to me! What's next? * Can we now remove ->_to_api (and so $to_api_mappinp) from Koha/REST/V1/Cities.pm * What about ->_to_model (and so $to_model_mapping)? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #17)
Looks great to me!
* Can we now remove ->_to_api (and so $to_api_mappinp) from Koha/REST/V1/Cities.pm
we still can't.
* What about ->_to_model (and so $to_model_mapping)?
I was thinking of: Koha::Object->new_from_api Koha::Object->update_from_api
What's next?
The next step is to file a bug in which we do the same for the other controllers. And then another one for implementing those two methods I propose. And then another one depending on these, for changing Koha::REST::Plugins::Objects so it uses the internal methods instead of expecting the to_api and to_model params. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Tomás Cohen Arazi from comment #18)
(In reply to Jonathan Druart from comment #17)
Looks great to me!
* Can we now remove ->_to_api (and so $to_api_mappinp) from Koha/REST/V1/Cities.pm
we still can't.
Why? That seems to be the very next step to me :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #19)
(In reply to Tomás Cohen Arazi from comment #18)
(In reply to Jonathan Druart from comment #17)
Looks great to me!
* Can we now remove ->_to_api (and so $to_api_mappinp) from Koha/REST/V1/Cities.pm
we still can't.
Why? That seems to be the very next step to me :)
Yes, yes. But we can't until we adapt Koha::REST::Plugin::Objects->search or provide an alternative implementation (maybe in Koha::Objects->search_from_api) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #15)
Depending on strict mode I have two results of the Object.t test:
not ok 1 - Exception thrown correctly # Failed test 'Exception thrown correctly' # at t/db_dependent/Koha/Object.t line 411. # expecting: Koha::Exceptions::Object::BadValue # found: normal exit # Looks like you failed 1 test of 1. not ok 16 - Bad value tests
# Failed test 'Exception thrown correctly' # at t/db_dependent/Koha/Object.t line 411. # expecting: Koha::Exceptions::Object::BadValue # found: DBIx::Class::Exception (DBIx::Class::Storage::DBI::_dbh_execute(): Incorrect datetime value: 'wrong_value' for column `koha_master`.`borrowers`.`lastseen` at row 1 at /usr/share/koha/Koha/Object.pm line 156 # ) # Looks like you failed 1 test of 1.
Ok, but that's not something related to this bug, you just found that if we manage not to run the tests in strict mode on a dev env (i.e. using perl instead of prove) the exception is not thrown, fair enough. I'm setting this one back to Signed-off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #21)
Ok, but that's not something related to this bug, you just found that if we manage not to run the tests in strict mode on a dev env (i.e. using perl instead of prove) the exception is not thrown, fair enough.
I'm setting this one back to Signed-off.
Hmm. Did you misread my comment? I tried both modes. And I see two failures. Please confirm. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #22)
(In reply to Tomás Cohen Arazi from comment #21)
Ok, but that's not something related to this bug, you just found that if we manage not to run the tests in strict mode on a dev env (i.e. using perl instead of prove) the exception is not thrown, fair enough.
I'm setting this one back to Signed-off.
Hmm. Did you misread my comment? I tried both modes. And I see two failures. Please confirm.
I confirm I get the failure on master :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #24 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #22)
(In reply to Tomás Cohen Arazi from comment #21)
Ok, but that's not something related to this bug, you just found that if we manage not to run the tests in strict mode on a dev env (i.e. using perl instead of prove) the exception is not thrown, fair enough.
I'm setting this one back to Signed-off.
Hmm. Did you misread my comment? I tried both modes. And I see two failures. Please confirm.
I only managed to see failures when I had sql_strict_modes disabled and run the tests using 'perl' instead of 'prove'. I set it back to SO because the failure I found was not related to the patchset. Will re-check. Using koha-testing-docker here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23825 --- Comment #25 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- See bug 23825. I get the failure using prove. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93891|0 |1 is obsolete| | --- Comment #26 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 94396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94396&action=edit Bug 23770: Add Koha::Object(s)->to_api method Generic method that changes the attribute names of an object in the presence of the to_api_mapping method. It otherwise falls back to returning the TO_JSON output. This is WIP submitted early for scrutiny. Tests and example usage in an API controller coming. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93892|0 |1 is obsolete| | --- Comment #27 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 94397 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94397&action=edit Bug 23770: Add to_api_mapping method to Koha::City Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93893|0 |1 is obsolete| | --- Comment #28 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 94398 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94398&action=edit Bug 23770: Unit tests This patch introduces tests for the new to_api method introduced in Koha::Object(s). It uses Koha::City as a sample for simplicity. And it also uses Koha::Illrequests to test the case in which there's no to_api_mapping method defined on the class, to highlight that a fallback to calling TO_JSON is done. [1] [1] This is done under the assumption Illrequests controller code doesn't use any kind of mapping as the rest of the API controllers do, so there's little chance it would be added in a future. To test: 1. Apply this patchset 2. Run: $ kshell k$ prove t/db_dependent/Koha/Object.t \ t/db_dependent/Koha/Objects.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Sponsored-by: ByWater Solutions Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93894|0 |1 is obsolete| | --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 94399 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94399&action=edit Bug 23770: (follow-up) Add tests for Koha::Objects->TO_JSON Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93895|0 |1 is obsolete| | --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 94400 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94400&action=edit Bug 23770: (follow-up) Use ->to_api in /cities This patch aims to prove the behaviour does not differ. So you can run the tests for the endpoints, and the behaviour remains. The mappings and methods cannot be removed until $c->objects->search is fixed to make use of them as well. That will happen once all used Koha::Object-based classes implement the mappings. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/api/v1/cities.t => SUCCESS: Tests pass! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #24)
I set it back to SO because the failure I found was not related to the patchset. Will re-check. Using koha-testing-docker here.
Although I can cause a failure with prove too, I will not block this patch set since it seems that the regex in sub store should be improved and we opened a report for that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23843 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23843 [Bug 23843] Make existing endpoints use Koha::Object(s)->to_api -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |19.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23770 --- Comment #32 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org