Bug 31450

Summary: HTML customizations and news will not display on OPAC without a publication date
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: ToolsAssignee: Owen Leonard <oleonard>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: major    
Priority: P5 - low CC: aleisha, alexbuckley, caroline.cyr-la-rose, david, martin.renvoize, samalau
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the display of news, HTML customizations, and pages on the OPAC - a publication date is now required for all types of additional content. Previously, news items and HTML customizations were not shown if they didn't have a publication date (this behavour was not obvious from the forms).
Version(s) released in:
25.05.00,24.11.02,24.05.08
Circulation function:
Attachments: Bug 31450 - HTML customizations and News will not display on OPAC without Publication date
Bug 31450 - HTML customizations and News will not display on OPAC without Publication date
Bug 31450: HTML customizations and News will not display on OPAC without Publication date
Bug 31450: Remove some debug lines
Bug 31450: HTML customizations and News will not display on OPAC without Publication date
Bug 31450: Remove some debug lines
Bug 31450: (follow-up) Add hint about empty publication date
Bug 31450: HTML customizations and News will not display on OPAC without Publication date
Bug 31450: Remove some debug lines
Bug 31450: (follow-up) Add hint about empty publication date
Bug 31450: Make additional contents publication date required
Bug 31450: Make additional contents publication date required
Bug 31450: Make additional contents publication date required

Description Lucas Gass (lukeg) 2022-08-24 14:21:47 UTC
To recreate:

-Create some HTML Customizations and some News item that are set to display on the OPAC.
-Go to the OPAC and notice none of these display. 

Possibly from Bug 15326?
Comment 1 Lucas Gass (lukeg) 2022-08-24 20:27:38 UTC
I see that this only happens when I do not set a "Publication date:". That makes sense for News, but HTML customizations should not required a Publication date or an Expiration date
Comment 2 Paul Derscheid 2022-08-26 12:30:08 UTC Comment hidden (obsolete)
Comment 3 Paul Derscheid 2022-08-26 12:32:45 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2022-11-16 23:46:38 UTC
Hi Paul, could you please check the patch? It only seems to be removing some debug lines.
Comment 5 Caroline Cyr La Rose 2023-02-15 15:28:56 UTC
I think the obsoleted patch wasn't supposed to be?
Comment 6 Katrin Fischer 2023-02-18 11:08:28 UTC
*** Bug 32987 has been marked as a duplicate of this bug. ***
Comment 7 Katrin Fischer 2023-02-18 11:44:02 UTC
If the commit line is exactly the same, one patch will overwrite the other. I'll fix it.
Comment 8 Katrin Fischer 2023-02-18 11:46:07 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2023-02-18 11:46:09 UTC Comment hidden (obsolete)
Comment 10 Owen Leonard 2023-02-18 17:36:29 UTC Comment hidden (obsolete)
Comment 11 Owen Leonard 2023-02-18 17:36:32 UTC Comment hidden (obsolete)
Comment 12 Owen Leonard 2023-02-18 17:36:34 UTC Comment hidden (obsolete)
Comment 13 Caroline Cyr La Rose 2023-02-20 15:09:39 UTC
With the patch, my HTML customization with publication date in the future is displayed.

Without the patch

HTML customization - pub date today    - Displayed     - OK
HTML customization - pub date tomorrow - Not displayed - OK
HTML customization - no pub date       - Not displayed - Not OK
News               - pub date today    - Displayed     - OK
News               - pub date tomorrow - Not displayed - OK
News               - no pub date       - Not displayed - OK

With the patch

HTML customization - pub date today    - Displayed     - OK
HTML customization - pub date tomorrow - Displayed     - Not OK
HTML customization - no pub date       - Displayed     - OK
News               - pub date today    - Displayed     - OK
News               - pub date tomorrow - Not displayed - OK
News               - no pub date       - Not displayed - OK

https://snipboard.io/H8rGQj.jpg
Comment 14 Katrin Fischer 2023-02-20 20:22:23 UTC
Setting to failed QA - I believe if a pubdate is set, it should be respected.
Comment 15 Owen Leonard 2024-06-14 17:39:14 UTC Comment hidden (obsolete)
Comment 16 Owen Leonard 2024-06-14 17:39:16 UTC Comment hidden (obsolete)
Comment 17 Owen Leonard 2024-06-14 17:39:19 UTC Comment hidden (obsolete)
Comment 18 Owen Leonard 2024-06-14 17:40:11 UTC
Rebased, but comment 13 is still valid:

> With the patch
> 
> HTML customization - pub date today    - Displayed     - OK
> HTML customization - pub date tomorrow - Displayed     - Not OK
> HTML customization - no pub date       - Displayed     - OK
> News               - pub date today    - Displayed     - OK
> News               - pub date tomorrow - Not displayed - OK
> News               - no pub date       - Not displayed - OK
Comment 19 Sam Lau 2024-07-23 21:44:04 UTC
Wouldn't it be possible and slightly easier just to make the publication date field required so it has to have data before submitting? Or is the issue here more so that it shouldn't even be required in the first place?
Comment 20 Lucas Gass (lukeg) 2024-07-23 21:47:23 UTC
(In reply to Sam Lau from comment #19)
> Wouldn't it be possible and slightly easier just to make the publication
> date field required so it has to have data before submitting? Or is the
> issue here more so that it shouldn't even be required in the first place?

I think making the field required is a simple and effective solution to the problem.
Comment 21 Owen Leonard 2024-12-10 13:30:18 UTC
Created attachment 175350 [details] [review]
Bug 31450: Make additional contents publication date required

HTML customizations and news will not display without a publication
date, so we should make it required. This patch adds client-side
validation of the field to check that it's filled.

To test, apply the patch and go to Tools -> News (or HTML
customizations, or Pages).

- Click "New entry"
- Try to submit this new entry without entering a publication date.
- You should be prevented from submitting the form.
- Fill in the publication date and confirm that the form submits
  correctly.

Sponsored-by: Athens County Public Libraries
Comment 22 Brendan Lawlor 2024-12-11 19:30:43 UTC
Created attachment 175379 [details] [review]
Bug 31450: Make additional contents publication date required

HTML customizations and news will not display without a publication
date, so we should make it required. This patch adds client-side
validation of the field to check that it's filled.

To test, apply the patch and go to Tools -> News (or HTML
customizations, or Pages).

- Click "New entry"
- Try to submit this new entry without entering a publication date.
- You should be prevented from submitting the form.
- Fill in the publication date and confirm that the form submits
  correctly.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 23 Martin Renvoize (ashimema) 2024-12-16 18:52:46 UTC
Created attachment 175564 [details] [review]
Bug 31450: Make additional contents publication date required

HTML customizations and news will not display without a publication
date, so we should make it required. This patch adds client-side
validation of the field to check that it's filled.

To test, apply the patch and go to Tools -> News (or HTML
customizations, or Pages).

- Click "New entry"
- Try to submit this new entry without entering a publication date.
- You should be prevented from submitting the form.
- Fill in the publication date and confirm that the form submits
  correctly.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 24 Katrin Fischer 2024-12-20 16:58:00 UTC
The bug description doesn't make it clear what the patch does: it makes the input required, but doesn't make customizations without publishing date display (I understand this could be an issue for updating installations). A little re-phrase might help make things more clear.
Comment 25 Katrin Fischer 2024-12-23 08:37:49 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 26 Paul Derscheid 2025-02-03 19:08:47 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.01
Comment 27 Alex Buckley 2025-03-14 02:44:38 UTC
Nice work everyone!

Pushed to 24.05.x for 24.05.08