Koha-clms/t/db_dependent/Template/Plugin
Baptiste Wojtkowski 4ad5cbdb97
Bug 37684: Direct link to expired news are broken
When using a direct link to a news (koha.url/cgi-bin/koha/opac-main.pl?news_id=XXX), the link is broken if the news is expired.

Formerly, a using AdditionalContent->get( id => "my_news_id") on an
expired news was returning a news, and calling get without id was
returning all news but the expired ones.

This patch adds tests to check this behaviour by adding one expired news and performing following new tests:
1 - It may not be returned by AdditionalContent.get()
2 - It must be returned by AdditionalContent.get() using its id

This patch fixes the behaviour by addind the new behaviour or
AdditionalContent.get:
1 - Any news must be returned by AdditionalContent.get() using its id;

TEST PLAN:
1 - Apply patch
2 - Remove the changes made to Koha/AdditionalContents.pm
3 - Run tests -> one test must fail
4 - Create a news with a expired expiration date, notice the id of the
  news in the url of the modification panel
5 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
  it does not work
6 - Reapply the whole patch
7 - Run test -> all test must pass
8 - Go to "opac.url/cgi-bin/koha/opac-main.pl?news_id=MY_ID" -> notice
  it does work now

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-07 17:32:38 +01:00
..
AdditionalContents.t Bug 37684: Direct link to expired news are broken 2024-11-07 17:32:38 +01:00
AuthorisedValues.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Branches.t Bug 32721: (QA follow-up) Drop fields from API response 2023-10-19 16:00:56 -03:00
Categories.t Bug 32127: Add unit test 2023-04-14 11:35:24 -03:00
CirculationRules.t Bug 24154: (follow-up) Make parameter and variable more explicit, add tests 2021-05-10 10:27:53 +02:00
Frameworks.t Bug 33607: Add framework display to staff details page 2023-05-16 15:17:43 -03:00
KohaDates.t Bug 28931: Use EXPORT_OK from Koha::DateUtils 2021-10-07 11:01:05 +02:00
KohaTimes.t Bug 38043: Add unit tests for KohaTimes TT filter 2024-10-11 11:13:54 +02:00
NoticeTemplates.t Bug 29393: (QA follow-up) Tidy and make executable the new test 2024-04-29 17:38:01 +02:00
To.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00