This is bug 28844 reworked with the relationship defined in the reverse way. There can be multiple suggestions for the same title currently (the check for duplicate suggestions includes the suggestedby field in the search, so only a single patron is prevented from requesting the same book twice) While we can order only from a single suggestion, bug 19358 and 31632 seek to allow linking multiple suggestions to an order, I believe we need to define the relationship this way now, to allow for future changes.
Created attachment 160576 [details] [review] Bug 35717: DB changes Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 160577 [details] [review] Bug 35717: DBIC schema changes
Created attachment 160578 [details] [review] Bug 35717: Add link between suggestions and orders Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 160579 [details] [review] Bug 35717: Remove GetSuggestionInfoFromBiblionumber Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 160580 [details] [review] Bug 35717: Replace GetSuggestionFromBiblionumber Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 160581 [details] [review] Bug 35717: Remove GetSuggestionFromBiblionumber Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 160582 [details] [review] Bug 35717: Adjust other calls Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 160583 [details] [review] Bug 35717: Tidy
Test plan: 1 - apply patch, reset_all 2 - create purchase suggestion 3 - accept purchase suggestion 4 - create and receive order from suggestion 5 - confirm that notices were generated as suggestion is accepted, ordered, received 6 - confirm that order number is present in suggestions data Anything else I need to check here?
Test plan: 1 - apply patch, reset_all 2 - create purchase suggestion 3 - accept purchase suggestion 4 - create and receive order from suggestion 5 - confirm that notices were generated as suggestion is accepted, ordered, received 6 - confirm that order number is present in suggestions data 7 - submit a second suggestion, accept it, create order from it 8 - cancel order from suggestion, confirm suggestion status reverts from "Ordered" to "Accepted" and order number is removed from suggestion
Hi these patches applied, I'm getting an error when attempting to receive an order tied to a suggestion. It looks like maybe an undefined basket number?
(In reply to Andrew Fuerste-Henry from comment #11) > Hi these patches applied, I'm getting an error when attempting to receive an > order tied to a suggestion. It looks like maybe an undefined basket number? I don't recreate this. Did you updatedatabase after applying the patch?
(In reply to Lucas Gass from comment #12) > (In reply to Andrew Fuerste-Henry from comment #11) > > Hi these patches applied, I'm getting an error when attempting to receive an > > order tied to a suggestion. It looks like maybe an undefined basket number? > > I don't recreate this. Did you updatedatabase after applying the patch? I'm getting this error on a sandbox that was provisioned with the patch applied from the start. My understanding is that inherently includes an updatedatabase, and I can see via SQL that the suggestions table *does* include the ordernumber field.
(In reply to Andrew Fuerste-Henry from comment #11) > Hi these patches applied, I'm getting an error when attempting to receive an > order tied to a suggestion. It looks like maybe an undefined basket number? Was the suggestion created before or after applying the patch?
(In reply to Katrin Fischer from comment #14) > (In reply to Andrew Fuerste-Henry from comment #11) > > Hi these patches applied, I'm getting an error when attempting to receive an > > order tied to a suggestion. It looks like maybe an undefined basket number? > > Was the suggestion created before or after applying the patch? After. I tested this on a sandbox with the patch applied from creation.
I guess that was wishful thinking. I hope Nick will have time to have a look soon.
Created attachment 164834 [details] [review] Bug 35717: DB changes Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 164835 [details] [review] Bug 35717: DBIC schema changes
Created attachment 164836 [details] [review] Bug 35717: Add link between suggestions and orders Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 164837 [details] [review] Bug 35717: Remove GetSuggestionInfoFromBiblionumber Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 164838 [details] [review] Bug 35717: Replace GetSuggestionFromBiblionumber Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 164839 [details] [review] Bug 35717: Remove GetSuggestionFromBiblionumber Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 164840 [details] [review] Bug 35717: Adjust other calls Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
And bug 31632? Can we maybe all discuss and move toward a single direction at the same time?...