Summary: | dbic_merge_prefetch is not handling recursive cases correctly | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Architecture, internals, and plumbing | Assignee: | Agustín Moyano <agustinmoyano> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | 1joynelson, martin.renvoize, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00
|
|
Circulation function: | |||
Bug Depends on: | 24356 | ||
Bug Blocks: | 20212 | ||
Attachments: |
Bug 24830: Fix parse_prefetch recursion and +count cases
Bug 24830: Add tests Bug 24830: Fix parse_prefetch recursion and +count cases Bug 24830: Fix parse_prefetch recursion and +count cases Bug 24830: Add tests Bug 24830: Fix parse_prefetch recursion and +count cases Bug 24830: Add tests Bug 24830: Fix parse_prefetch recursion and +count cases |
Description
Tomás Cohen Arazi (tcohen)
2020-03-09 13:49:28 UTC
I also noticed the relation+count case is not being handled correctly (i.e. it won't be prefetch). Created attachment 100393 [details] [review] Bug 24830: Fix parse_prefetch recursion and +count cases When a child of a prefetched element wasn't found on element's prefetch_whitelist, no prefetch element was returned.. including element it self. Now we return element's name if no child was found. Also, embeded keys that ended with +count where taken literaly. Now we search the correct key by stripping _count of embedded element if it was declared as "is_count" Should this be needs signoff? (In reply to Martin Renvoize from comment #3) > Should this be needs signoff? Hi Martin, not yet.. I still have to design how to test. Created attachment 100664 [details] [review] Bug 24830: Add tests Created attachment 100665 [details] [review] Bug 24830: Fix parse_prefetch recursion and +count cases When a child of a prefetched element wasn't found on element's prefetch_whitelist, no prefetch element was returned.. including element it self. Now we return element's name if no child was found. Also, embeded keys that ended with +count where taken literaly. Now we search the correct key by stripping _count of embedded element if it was declared as "is_count" Created attachment 100666 [details] [review] Bug 24830: Fix parse_prefetch recursion and +count cases When a child of a prefetched element wasn't found on element's prefetch_whitelist, no prefetch element was returned.. including element it self. Now we return element's name if no child was found. Also, embeded keys that ended with +count where taken literaly. Now we search the correct key by stripping _count of embedded element if it was declared as "is_count" To test: 1. Apply test patch but not this one 2. prove t/Koha/REST/Plugin/Query.t CHECK => tests shoul fail 3. Apply this patch 4. prove t/Koha/REST/Plugin/Query.t SUCCESS => tests pass 5. Sign off Created attachment 100689 [details] [review] Bug 24830: Add tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 100690 [details] [review] Bug 24830: Fix parse_prefetch recursion and +count cases When a child of a prefetched element wasn't found on element's prefetch_whitelist, no prefetch element was returned.. including element it self. Now we return element's name if no child was found. Also, embeded keys that ended with +count where taken literaly. Now we search the correct key by stripping _count of embedded element if it was declared as "is_count" To test: 1. Apply test patch but not this one 2. prove t/Koha/REST/Plugin/Query.t CHECK => tests shoul fail 3. Apply this patch 4. prove t/Koha/REST/Plugin/Query.t SUCCESS => tests pass 5. Sign off Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 101089 [details] [review] Bug 24830: Add tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 101090 [details] [review] Bug 24830: Fix parse_prefetch recursion and +count cases When a child of a prefetched element wasn't found on element's prefetch_whitelist, no prefetch element was returned.. including element it self. Now we return element's name if no child was found. Also, embeded keys that ended with +count where taken literaly. Now we search the correct key by stripping _count of embedded element if it was declared as "is_count" To test: 1. Apply test patch but not this one 2. prove t/Koha/REST/Plugin/Query.t CHECK => tests shoul fail 3. Apply this patch 4. prove t/Koha/REST/Plugin/Query.t SUCCESS => tests pass 5. Sign off Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Nice work everyone! Pushed to master for 20.05 not backported to 19.11.x due to dependencies |