Summary: | Regression: information from existing bib no longer populating on suggest for purchase | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | OPAC | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | david, fridolin.somers, jonathan.druart, kyle, m.de.rooy, victor, wainuiwitikapark |
Version: | Main | Keywords: | regression, rel_20_11_candidate, rel_21_05_candidate |
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29321 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29696 |
||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This restores the behaviour for purchase suggestions for an existing title, so that the suggestion form is pre-filled with the details from the existing record.
|
Version(s) released in: |
21.11.00,21.05.05,20.11.12,20.05.18
|
Circulation function: | |||
Bug Depends on: | 14963, 28941 | ||
Bug Blocks: | 29311 | ||
Attachments: |
Bug 29416: (bug 28941 follow-up) Restore suggestion prefill
Bug 29416: (bug 28941 follow-up) Restore suggestion prefill Bug 29416: (bug 28941 follow-up) Restore suggestion prefill |
Description
Andrew Fuerste-Henry
2021-11-04 13:45:08 UTC
Yes, caused by commit 586bed1319592e05f5dc3acf64a1dba8cae69d6b Bug 28941: Filter suggestion inputs at the OPAC Created attachment 127347 [details] [review] Bug 29416: (bug 28941 follow-up) Restore suggestion prefill From commit 586bed1319592e05f5dc3acf64a1dba8cae69d6b Bug 28941: Filter suggestion inputs at the OPAC But later in the script we send { suggestion => %$suggestion } to the template and so erase the variable previously passed. Test plan: Login at the OPAC Go to the bibliographic detail page Suggest for purchase => The form must be prefilled! QA: Looking here Out of scope, just seeing this: { last unless ($op eq 'add'); # ETC } Normally we only use last in a loop (for, while). Perl allows this and says: "Note that a block by itself is semantically identical to a loop that executes once. Thus last can be used to effect an early exit out of such a block." But surely this should just have been: if( $op eq 'add' ) { # ETC } Created attachment 127354 [details] [review] Bug 29416: (bug 28941 follow-up) Restore suggestion prefill From commit 586bed1319592e05f5dc3acf64a1dba8cae69d6b Bug 28941: Filter suggestion inputs at the OPAC But later in the script we send { suggestion => %$suggestion } to the template and so erase the variable previously passed. Test plan: Login at the OPAC Go to the bibliographic detail page Suggest for purchase => The form must be prefilled! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested, seems to work ;) Can be backported as a minimal fix now. But surely this code should get more attention in terms of quality. Advanced hacking. Created attachment 127356 [details] [review] Bug 29416: (bug 28941 follow-up) Restore suggestion prefill From commit 586bed1319592e05f5dc3acf64a1dba8cae69d6b Bug 28941: Filter suggestion inputs at the OPAC But later in the script we send { suggestion => %$suggestion } to the template and so erase the variable previously passed. Test plan: Login at the OPAC Go to the bibliographic detail page Suggest for purchase => The form must be prefilled! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> (In reply to Marcel de Rooy from comment #4) > Out of scope, just seeing this: > > { > last unless ($op eq 'add'); > # ETC > } > > Normally we only use last in a loop (for, while). Perl allows this and says: > "Note that a block by itself is semantically identical to a loop that > executes once. Thus last can be used to effect an early exit out of such a > block." > > But surely this should just have been: > > if( $op eq 'add' ) { > # ETC > } Please add a bug report for that. Pushed to master for 21.11, thanks to everybody involved! Pushed to 21.05.x for 21.05.05 Pushed to 20.11.x for 20.11.12 Backported: Pushed to 20.05.x branch for 20.05.18 Not backporting to 19.11.x - LTS version will just backport security patches |