Koha-clms/t/db_dependent
Baptiste Wojtkowski 1be8a9eedd 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>
(cherry picked from commit 4ad5cbdb97)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-12-05 21:51:37 +00:00
..
Acquisition Bug 32132: Fix failing tests 2024-04-23 16:47:05 +01:00
Auth Bug 36056: Clarify subpermissions AND behavior 2024-03-07 17:35:40 +01:00
AuthoritiesMarc
…
Authority Bug 36917: (follow-up) Add FIXME for marcflavour 2024-05-24 15:36:43 +02:00
Biblio Bug 35993: (follow-up) Another fix for MarcOverlayRules.t 2024-05-02 15:03:41 +02:00
Budgets
…
Circulation Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
CourseReserves
…
Creators Bug 37720: (follow-up) Adjust tests 2024-10-01 13:42:28 +00:00
Exporter
…
Holds Bug 36923: Remove warnings from Holds/LocalHoldsPriority.t 2024-05-24 15:36:46 +02:00
HoldsQueue Bug 35826: Add unit tests. 2024-04-26 18:06:18 +02:00
Illrequest Bug 34838: (QA follow-up): TypeDisclaimer tests - Add 'type' to request metadata 2024-06-27 16:21:40 +00:00
Items Bug 36010: Fix Items/AutomaticItemModificationByAge.t failing since Bug 32029 2024-03-07 16:36:46 +01:00
Koha Bug 37872: Add tests 2024-12-05 21:34:24 +00:00
LDAP
…
Labels Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
Letters Bug 37757: (follow-up) Adjust existing tests 2024-11-18 21:55:39 +00:00
Members Bug 33947: Remove GetAllIssues 2023-10-20 11:03:03 -03:00
OAI
…
Patron Bug 25996: (follow-up) Log the entire object on deletion 2024-05-03 18:02:18 +02:00
Record Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-07 23:02:54 +00:00
Reports Bug 37508: (QA follow-up) Use ->check_columns 2024-08-12 15:35:15 -03:00
Reserves Bug 35959: Add missing use statements in tests 2024-11-18 17:44:57 +00:00
SIP Bug 37582: Add unit test 2024-11-22 21:14:42 +00:00
Search
…
Serials
…
Template/Plugin Bug 37684: Direct link to expired news are broken 2024-12-05 21:51:37 +00:00
Utils Bug 34913: Adjust C4::Utils::DataTables::VirtualShelves 2024-01-26 15:13:42 +01:00
api/v1 Bug 37535: Regression tests 2024-11-18 18:40:08 +00:00
cronjobs
…
data Bug 35418: Add TR_B2 tests 2023-11-29 17:36:11 -03:00
misc/translator
…
mojo Bug 36598: (QA follow-up): tidy up code 2024-09-30 15:28:48 +00:00
selenium Bug 37283: Update expected error page title 2024-11-18 18:05:47 +00:00
www Bug 32693: Fix history.t 2024-05-08 18:23:57 +02:00
00-strict.t Bug 36999: Fix 00-strict.t fails to find koha_perl_deps.pl 2024-07-18 17:33:55 +00:00
Accounts.t Bug 34912: Add 14 hours to 1970 date in Account(s).t 2023-10-04 09:15:39 -04:00
Acquisition.t Bug 32132: (RM follow-up) Use testbuilder in Acquisitions.t 2024-04-24 10:08:28 +01:00
Amazon.t
…
ArticleRequests.t
…
AudioAlerts.t
…
Auth.t Bug 37104: Unit tests 2024-11-18 17:21:25 +00:00
AuthUtils.t
…
Auth_with_cas.t
…
Auth_with_ldap.t Bug 36822: (QA follow-up): Fix now time in tests 2024-11-15 16:12:30 +00:00
Auth_with_shibboleth.t Bug 37757: (follow-up) Adjust existing tests 2024-11-18 21:55:39 +00:00
AuthorisedValues.t Bug 28869: Unit tests 2024-05-17 10:36:24 +02:00
AuthoritiesMarc.t Bug 35989: (QA follow-up): Fix QA tests 2024-06-27 13:35:23 +00:00
AuthoritiesMarc_GetTagsLabels.t
…
Barcodes.t Bug 37070: (QA follow-up) Fix qa script issues 2024-11-18 23:24:53 +00:00
Barcodes_ValueBuilder.t
…
Biblio.t Bug 30648: Tidy 2024-12-05 16:47:04 +00:00
Biblio_holdsqueue.t
…
Breeding.t Bug 28166: (QA follow-up) Fix and tidy tests and code 2023-10-23 11:33:50 -03:00
Breeding_Auth.t
…
Budgets.t Bug 31631: (QA follow-up) Tidy code 2023-10-18 15:41:37 -03:00
Cache.t
…
Calendar.t
…
Charset.t
…
Circulation.t Bug 37505: (QA follow-up) Adjust tests 2024-11-19 15:59:42 +00:00
Circulation_holdsqueue.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
Clubs.t
…
Context.t
…
Contract.t
…
CourseReserves.t Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
DecreaseLoanHighHolds.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
Filter_MARC_ViewPolicy.t
…
Fines.t
…
FrameworkPlugin.t Bug 37146: Add tests 2024-07-25 14:21:56 +00:00
Heading.t
…
Heading_MARC21.t
…
Hold.t Bug 34032: (QA follow-up) Tidy code 2024-04-29 09:35:38 +02:00
Holds.t Bug 17617: Unit tests 2023-11-08 11:41:26 -03:00
HoldsQueue.t Bug 32565: (follow-up) Tidy 2024-04-30 14:32:07 +02:00
Holidays.t Bug 27249: Replace DateTime->now by dt_from_string 2023-10-17 14:45:34 -03:00
ILSDI_Services.t Bug 38233: Add regression tests 2024-12-05 18:10:41 +00:00
ImportBatch.t
…
ImportExportFramework.t
…
Installer.t
…
Items.t Bug 37550: Unit test for CheckItemPreSave 2024-12-05 21:50:39 +00:00
Koha.t Bug 34812: Move subtests to db_dependent/Koha.t 2023-09-18 12:06:27 -03:00
Koha_Database.t
…
Koha_Elasticsearch.t Bug 35138: Fix Koha_Elasticsearch.t 2024-04-30 12:00:59 +02:00
Koha_ExternalContent_OverDrive.t
…
Koha_MetadataRecord_Authority.t
…
Koha_Misc_Files.t
…
Languages.t
…
Letters.t Bug 37757: (follow-up) Adjust existing tests 2024-11-18 21:55:39 +00:00
LibraryGroups.t
…
Linker_Default.t Bug 35125: Respect LinkerConsiderThesaurus in update_cache 2024-10-25 21:35:48 +00:00
Linker_FirstMatch.t
…
Log.t Bug 25159: (QA follow-up) Tidy changes 2024-05-02 16:47:44 +02:00
MarcModificationTemplates.t Bug 24480: (follow-up) Adjust tests 2023-11-03 12:04:35 -03:00
Matcher.t
…
Members.t Bug 26170: Add protected status for patrons 2023-11-01 17:23:06 -03:00
Message.t Bug 37757: (follow-up) Adjust existing tests 2024-11-18 21:55:39 +00:00
MungeMarcPrice.t
…
Overdues.t Bug 36128: (QA follow-up) Add regression test 2024-07-19 15:21:50 +00:00
Passwordrecovery.t
…
PatronLists.t Bug 32730: Add Patron Lists tab to patron details and circulation pages 2023-11-01 17:23:09 -03:00
Patroncards.t
…
Patrons.t Bug 36508: Unit tests 2024-04-30 14:32:04 +02:00
Prices.t Bug 34967: Move to db_dependent 2023-10-03 09:24:50 -04:00
Record.t
…
RecordProcessor_EmbedSeeFromHeadings.t
…
Reports.t
…
Reserves.t Bug 36687: (RM follow-up) Fix unit tests 2024-05-09 09:22:00 +01:00
RotatingCollections.t
…
Search.t Bug 36924: Remove warning "Value not allowed for auto_incr itemnumber in Item" 2024-05-23 17:51:15 +02:00
Serials.t Bug 37476: Unit tests 2024-08-29 16:59:23 +00:00
Serials_2.t
…
Service.t
…
ShelfBrowser.t
…
Sitemapper.t
…
SocialData.t
…
StockRotationItems.t
…
StockRotationRotas.t
…
StockRotationStages.t
…
SuggestionEngine_ExplodedTerms.t
…
Suggestions.t Bug 19097: Adjust some GetMarcFromKohaField calls 2024-04-29 09:35:47 +02:00
TablesSettings.t
…
Tags.t
…
Templates.t
…
TestBuilder.t
…
Upload.t
…
UsageStats.t
…
Virtualshelves.t
…
XISBN.t
…
XSLT.t
…
check_kohastructure.t
…
check_sysprefs.t Bug 29948: Adjust sysprefs.sql 2024-05-13 16:24:17 +02:00
db_structure.t
…
rollingloans.t Bug 32496: Reduce unnecessary unblessings of objects in Circulation.pm 2023-09-22 10:52:39 -03:00
sysprefs.t Bug 36793: Unit test 2024-05-17 10:36:34 +02:00
yaml.t
…
zebra_config.pl
…