Bug 13746 - On creating a new subscription, notes fields get confused
Summary: On creating a new subscription, notes fields get confused
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-21 21:33 UTC by Katrin Fischer
Modified: 2015-12-03 22:02 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13746: On creating a new subscription, notes fields get confused (1.84 KB, patch)
2015-02-21 21:56 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 13746: On creating a new subscription, notes fields get confused (1.91 KB, patch)
2015-02-24 04:21 UTC, Brendan Gallagher
Details | Diff | Splinter Review
Bug 13746: On creating a new subscription, notes fields get confused (1.96 KB, patch)
2015-02-25 12:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13746: Add tests (2.60 KB, patch)
2015-02-25 12:25 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2015-02-21 21:33:47 UTC
When creating a new subscription, check 'manual history' and put text into the internal and public note fields. After saving, the notes are not only saved to the normal note fields, but also copied to the subscription history.

After initial creation of the subscription, the notes fields behave normally and are saved to the correct fields in the database when edited.
Comment 1 Katrin Fischer 2015-02-21 21:37:02 UTC
Database fields are:

Subscription
subscription.notes (public)
subscription.internalnotes (internal)

Subscription history
subscriptionhistory.opacnote (public)
subscripitonhistory.librariannote (internal)
Comment 2 Katrin Fischer 2015-02-21 21:56:12 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-02-21 21:57:59 UTC
All existing tests pass with the change. Not sure about new unit tests - could someone suggest what would be good to test here?
Comment 4 Brendan Gallagher 2015-02-22 23:27:29 UTC
Katrin - 

I feel like I've seen this before but described a little bit differently.  I am looking for a similar bug (I haven't found it yet).  I think I've seen language like - manual history fails.  (no comment for new direction on the unit tests).  If I do not find a similar bug then I'll be glad to test this.  Of course any enlightenment for me is always welcome.

Cheers,
Brendan
Comment 5 Katrin Fischer 2015-02-23 05:49:17 UTC
Hi Brendan, this is just for the note fields - the less complicated part of the self-updating history. I have seen some other things while testing in the issue related fields, but haven't looked into it yet.
Comment 6 Brendan Gallagher 2015-02-24 04:21:51 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-02-25 12:25:16 UTC
Created attachment 36165 [details] [review]
Bug 13746: On creating a new subscription, notes fields get confused

For every subscription we have 4 notes fields in Koha, 2 are in the
subscription itself and another 2 are in the subscription history.

When creating a new subscription, the notes fields from the
subscription get copied to the fields of the subscription history,
leading to doubled up display of notes in the OPAC.

To test:
- Add a new subscription without patch
  - check manual history
  - Fill in both notes fields
- Verify that the notes fields got also saved into the
  subscription history (easy from the Summary tab)
- Apply patch
- Add another subscription, like above
- Verify now only the subscription notes fields are saved
- Edit subscription and notes - verify all is ok
- Edit subscription history (Planning tab) - verify all is ok

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Jonathan Druart 2015-02-25 12:25:24 UTC
Created attachment 36166 [details] [review]
Bug 13746: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 9 Tomás Cohen Arazi 2015-03-15 12:11:16 UTC
Patches pushed to master.

Thanks Katrina and Jonathan!
Comment 10 Chris Cormack 2015-03-16 00:22:16 UTC
Pushed to 3.18.x will be in 3.18.5
Comment 11 Mason James 2015-04-23 03:32:02 UTC
Pushed to 3.16.x, will be in 3.16.10