Bug 23126 - Multiline entries in subscription history display with <br/> in OPAC
Summary: Multiline entries in subscription history display with <br/> in OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-14 13:28 UTC by Katrin Fischer
Modified: 2020-06-04 20:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00


Attachments
Bug 23126: Display multi-line entries in subscrpitions correctly (8.43 KB, patch)
2019-06-18 06:16 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23126: Remove more unnecessary linebreak processing from serial collection (1.17 KB, patch)
2019-06-21 05:48 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23126: Display multi-line entries in subscrpitions correctly (8.53 KB, patch)
2019-06-21 09:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 23126: Remove more unnecessary linebreak processing from serial collection (1.22 KB, patch)
2019-06-21 09:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 23126: Remove more unnecessary linebreak processing from serial collection (1.27 KB, patch)
2019-06-21 18:49 UTC, Arthur Bousquet
Details | Diff | Splinter Review
Bug 23126: Display multi-line entries in subscrpitions correctly (8.54 KB, patch)
2019-06-21 19:07 UTC, Nadine Pierre
Details | Diff | Splinter Review
Bug 23126: Remove more unnecessary linebreak processing from serial collection (1.33 KB, patch)
2019-06-21 19:07 UTC, Nadine Pierre
Details | Diff | Splinter Review
Bug 23126: Display multi-line entries in subscrpitions correctly (8.66 KB, patch)
2019-06-24 17:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23126: Remove more unnecessary linebreak processing from serial collection (1.40 KB, patch)
2019-06-24 17:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23126: Add tests (2.75 KB, patch)
2019-06-24 17:57 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 2019-06-14 13:28:09 UTC
When entering data in the subscription history manually, the GUI allows you to enter line breaks. The OPAC will display them as: <br>

Probably requires some correctiosn for filtering.
Comment 1 Katrin Fischer 2019-06-14 13:33:35 UTC
To test:

- Create a subscription, make sure "manual history" on the first page is checked
- Save the subscription
- Go to the subscription detail page, tab "planning"
- Click "Edit history" link there
- Enter data in the notes and other fields with line breaks
- Go to the OPAC detail page for this record
- Go to tab subscriptions > More details > Brief history
- Verify there are HTML tags displaying for the line breaks
Comment 2 Katrin Fischer 2019-06-18 06:16:45 UTC
Created attachment 90714 [details] [review]
Bug 23126: Display multi-line entries in subscrpitions correctly

There are several notes and other fields in a subscription that
can be entered as multi-line input with breaks. We should display
them as they were entered with keeping the line breaks intact.

To test:
- Add a subscription
  - Add comments including line breaks in internal and OPAC note
  - Check the manual history checkbox
- Go to the subscription detail page, tab 'Planning'
- Use the 'Edit history' link to edit the history
- Enter content with line breaks in all the input fields where
  it's possible
- Go to the OPAC detail page for your subscription record
- Go to tab 'Subscriptions' > More details > Brief history
- Verify the line breaks show there as <br>
- Apply patch
- Relaod page, verify all information displays correctly now
- Go back to the detail page, subscription tab - verify same there
- Go back to the subscription detail page in staff
  - Check editing the history works as expected
  - Verify information on all tabs displays correctly
  - Receive a serial issue - verify note on top displays right
  - Go to the serial collection page of the subscription - same there
Comment 3 Katrin Fischer 2019-06-18 06:19:55 UTC
This turned out to be a little bit bigger than a missing filter. 

GetSubscriptionsFromBiblionumber actually turned the \n to <br>, which we should never do but leave to the templates.

I removed the 3 lines doing that and have fixed every place in the templates where I found the variables displayed with TT filter html_line_breaks.

I have not submitted tests, because it seemed a little silly to test if the data does not contain <br>? Existing tests in t/db_dependent/Serials.t pass.
Comment 4 Mark Tompsett 2019-06-20 16:07:13 UTC
$ git grep "\\\n\/\\\<br"

Your patch is missing the serials collection pl even though you tweaked the tt.
Comment 5 David Nind 2019-06-20 20:42:28 UTC
I did test this and everything seems fine. I didn't sign off because of comment #4, will test again when ready.
Comment 6 Katrin Fischer 2019-06-21 05:48:41 UTC
Created attachment 90869 [details] [review]
Bug 23126: Remove more unnecessary linebreak processing from serial collection

This should have no visible effect on the templates as the
information the grep changes is not used in the template.

It's also strange, that these lines existed, as
GetSubscriptionsFromBiblionumber contained the same changes.
Comment 7 David Nind 2019-06-21 09:52:48 UTC
Created attachment 90886 [details] [review]
Bug 23126: Display multi-line entries in subscrpitions correctly

There are several notes and other fields in a subscription that
can be entered as multi-line input with breaks. We should display
them as they were entered with keeping the line breaks intact.

To test:
- Add a subscription
  - Add comments including line breaks in internal and OPAC note
  - Check the manual history checkbox
- Go to the subscription detail page, tab 'Planning'
- Use the 'Edit history' link to edit the history
- Enter content with line breaks in all the input fields where
  it's possible
- Go to the OPAC detail page for your subscription record
- Go to tab 'Subscriptions' > More details > Brief history
- Verify the line breaks show there as <br>
- Apply patch
- Relaod page, verify all information displays correctly now
- Go back to the detail page, subscription tab - verify same there
- Go back to the subscription detail page in staff
  - Check editing the history works as expected
  - Verify information on all tabs displays correctly
  - Receive a serial issue - verify note on top displays right
  - Go to the serial collection page of the subscription - same there

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2019-06-21 09:52:51 UTC
Created attachment 90887 [details] [review]
Bug 23126: Remove more unnecessary linebreak processing from serial collection

This should have no visible effect on the templates as the
information the grep changes is not used in the template.

It's also strange, that these lines existed, as
GetSubscriptionsFromBiblionumber contained the same changes.

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Arthur Bousquet 2019-06-21 18:49:38 UTC
Created attachment 90929 [details] [review]
Bug 23126: Remove more unnecessary linebreak processing from serial collection

This should have no visible effect on the templates as the
information the grep changes is not used in the template.

It's also strange, that these lines existed, as
GetSubscriptionsFromBiblionumber contained the same changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Comment 10 Nadine Pierre 2019-06-21 19:07:43 UTC
Created attachment 90931 [details] [review]
Bug 23126: Display multi-line entries in subscrpitions correctly

There are several notes and other fields in a subscription that
can be entered as multi-line input with breaks. We should display
them as they were entered with keeping the line breaks intact.

To test:
- Add a subscription
  - Add comments including line breaks in internal and OPAC note
  - Check the manual history checkbox
- Go to the subscription detail page, tab 'Planning'
- Use the 'Edit history' link to edit the history
- Enter content with line breaks in all the input fields where
  it's possible
- Go to the OPAC detail page for your subscription record
- Go to tab 'Subscriptions' > More details > Brief history
- Verify the line breaks show there as <br>
- Apply patch
- Relaod page, verify all information displays correctly now
- Go back to the detail page, subscription tab - verify same there
- Go back to the subscription detail page in staff
  - Check editing the history works as expected
  - Verify information on all tabs displays correctly
  - Receive a serial issue - verify note on top displays right
  - Go to the serial collection page of the subscription - same there

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Comment 11 Nadine Pierre 2019-06-21 19:07:48 UTC
Created attachment 90932 [details] [review]
Bug 23126: Remove more unnecessary linebreak processing from serial collection

This should have no visible effect on the templates as the
information the grep changes is not used in the template.

It's also strange, that these lines existed, as
GetSubscriptionsFromBiblionumber contained the same changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Comment 12 Jonathan Druart 2019-06-24 17:57:33 UTC
Created attachment 90967 [details] [review]
Bug 23126: Display multi-line entries in subscrpitions correctly

There are several notes and other fields in a subscription that
can be entered as multi-line input with breaks. We should display
them as they were entered with keeping the line breaks intact.

To test:
- Add a subscription
  - Add comments including line breaks in internal and OPAC note
  - Check the manual history checkbox
- Go to the subscription detail page, tab 'Planning'
- Use the 'Edit history' link to edit the history
- Enter content with line breaks in all the input fields where
  it's possible
- Go to the OPAC detail page for your subscription record
- Go to tab 'Subscriptions' > More details > Brief history
- Verify the line breaks show there as <br>
- Apply patch
- Relaod page, verify all information displays correctly now
- Go back to the detail page, subscription tab - verify same there
- Go back to the subscription detail page in staff
  - Check editing the history works as expected
  - Verify information on all tabs displays correctly
  - Receive a serial issue - verify note on top displays right
  - Go to the serial collection page of the subscription - same there

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2019-06-24 17:57:37 UTC
Created attachment 90968 [details] [review]
Bug 23126: Remove more unnecessary linebreak processing from serial collection

This should have no visible effect on the templates as the
information the grep changes is not used in the template.

It's also strange, that these lines existed, as
GetSubscriptionsFromBiblionumber contained the same changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2019-06-24 17:57:41 UTC
Created attachment 90969 [details] [review]
Bug 23126: Add tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Katrin Fischer 2019-06-25 06:04:40 UTC
Thank you for the tests!
Comment 16 Martin Renvoize 2019-06-25 16:20:24 UTC
Nice work!

Pushed to master for 19.11.00
Comment 17 Katrin Fischer 2019-07-13 10:33:20 UTC
The bug was found by my coworker while testing 18.11, would be great to see this backported.