From aa9663667eaa384e5e58165e4da2d71f0700871a Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 17 Feb 2021 11:59:51 +0100
Subject: [PATCH] Bug 22544: Restore newdate and timestamp for slip notices

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
---
 C4/Members.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/C4/Members.pm b/C4/Members.pm
index e277c590bf..b57d8f2057 100644
--- a/C4/Members.pm
+++ b/C4/Members.pm
@@ -595,6 +595,13 @@ sub IssueSlip {
         my @news;
         while ( my $n = $news->next ) {
             my $all = $n->unblessed_all_relateds;
+
+            # FIXME We keep newdate and timestamp for backward compatibility (from GetNewsToDisplay)
+            # But we should remove them and adjust the existing templates in a db rev
+            my $published_on_dt = output_pref({ dt => dt_from_string( $all->{pubished_on} ), dateonly => 1 });
+            $all->{newdate} = $published_on_dt;
+            $all->{timestamp} = $published_on_dt;
+
             push @news, {
                 opac_news => $all,
             };
-- 
2.20.1