From 6ae908a1566b734c2f76d6870e12d54633ad8924 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 22 Nov 2021 14:56:58 +0100
Subject: [PATCH] Bug 29544: Ensure logged in user is allowed to modify
 checkout note

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 opac/svc/checkout_notes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opac/svc/checkout_notes b/opac/svc/checkout_notes
index 4e95e260a6..c0678db2fc 100755
--- a/opac/svc/checkout_notes
+++ b/opac/svc/checkout_notes
@@ -75,7 +75,7 @@ if ($is_ajax) {
             }
         }
 
-        if ( $issue ) {
+        if ( $issue && $status eq "saved" ) {
             $issue->set({ notedate => dt_from_string(), note => $clean_note, noteseen => 0 })->store;
             if($clean_note) { # only send email if note not empty
                 my $branch = Koha::Libraries->find( $issue->branchcode );
-- 
2.11.0