Bug 39035 - CookieConsentBar message prints on slip when cookies aren’t accepted
Summary: CookieConsentBar message prints on slip when cookies aren’t accepted
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: William Lavoie
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-04 22:19 UTC by Marie-Luce Laflamme
Modified: 2025-02-26 12:19 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch fixes a bug where CookieConsent information would show up on printed material in the staff interface.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39035: CookieConsentBar message prints on slip when cookies aren’t accepted (2.27 KB, patch)
2025-02-05 20:53 UTC, William Lavoie
Details | Diff | Splinter Review
Bug 39035: Adding print media query to hide CookieConsentBar (753 bytes, patch)
2025-02-06 13:28 UTC, William Lavoie
Details | Diff | Splinter Review
Bug 39035: Adding print media query to hide cookie permissions (802 bytes, patch)
2025-02-07 17:08 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39035: Adding print media query to hide cookie permissions (859 bytes, patch)
2025-02-25 21:26 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marie-Luce Laflamme 2025-02-04 22:19:57 UTC
Hey everyone,

I ran into a small issue with the CookieConsent system in Koha. If you forget to accept Koha’s consent cookies on a computer, the CookieConsentBar message shows up on every printed slip from that computer.
The behaviour affect 24.05+ and main.

Steps to reproduce:

Before testing, make sure:

    - set the CookieConsent system preference to enable
    - set a CookieConsentBar message (configured in HTML personnalisations > Additional content > CookieConsentBar)

Test plan:

1. Open a different web browser that hasn’t accepted Koha’s cookies yet.
2. Log into the staff interface (do not accept cookies yet).
3. Find a patron account.
4. Click on "Print" and choose any slip.
5. Check the printed slip.
 ---> Koha is printing the CookieConsentBar message at the bottom, which shouldn’t be there.
6. Now, accept the cookies at the bottom of the screen.
7. Print another slip.
8. Check the new slip.
---> This time, the CookieConsentBar message is gone (as expected).
Comment 1 William Lavoie 2025-02-05 20:53:52 UTC
Created attachment 177557 [details] [review]
Bug 39035: CookieConsentBar message prints on slip when cookies aren’t accepted

I added a print media query in moremember-print.tt to avoid displaying
the cookies when printing a slip.

Before testing, make sure:

    - set the CookieConsent system preference to enable
    - set a CookieConsentBar message (configured in HTML personnalisations > Additional content > CookieConsentBar)

Test plan:

1. Open a different web browser that hasn’t accepted Koha’s cookies yet.
2. Log into the staff interface (do not accept cookies yet).
3. Find a patron account.
4. Click on "Print" and choose any slip.
5. Check the printed slip.
 ---> Koha is printing the CookieConsentBar message at the bottom, which shouldn’t be there.
6. Now, accept the cookies at the bottom of the screen.
7. Print another slip.
8. Check the new slip.
---> This time, the CookieConsentBar message is gone (as expected).
Comment 2 Owen Leonard 2025-02-06 12:13:21 UTC
Could you please put this change in print.css instead? Even if the problem has only been spotted with slips I think it's a change that should be made globally.
Comment 3 William Lavoie 2025-02-06 13:28:57 UTC
Created attachment 177570 [details] [review]
Bug 39035: Adding print media query to hide CookieConsentBar

Hi Owen,
You're right, thank you for the feedback. I have updated the patch and the test plan.

Test plan:
1. Set the CookieConsent system preference to enable
2. Set a CookieConsentBar message (configured in HTML personnalisations > Additional content > CookieConsentBar)
3. Open a different web browser that hasn’t accepted Koha’s cookies yet.
4. Log into the staff interface (do not accept cookies yet).
5. Find a patron account.
6. Click on "Print" and choose any slip.
7. Check the printed slip.
 ---> Koha is printing the CookieConsentBar message at the bottom, which shouldn’t be there.
8. Apply the patch
9. Print another slip.
10. Check the new slip.
---> This time, the CookieConsentBar message is gone (as expected).
Comment 4 Owen Leonard 2025-02-07 17:08:08 UTC
Created attachment 177650 [details] [review]
Bug 39035: Adding print media query to hide cookie permissions

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Marcel de Rooy 2025-02-21 11:00:54 UTC
Shouldnt this be a bug ?
Comment 6 Lucas Gass (lukeg) 2025-02-25 21:26:30 UTC
Created attachment 178698 [details] [review]
Bug 39035: Adding print media query to hide cookie permissions

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Lucas Gass (lukeg) 2025-02-25 21:28:30 UTC
PQA but we should file another bug to do this same treatment to the OPAC.
Comment 8 Katrin Fischer 2025-02-26 12:19:48 UTC
Pushed for 25.05!

Well done everyone, thank you!