Bug 23463: cn_sort needs to be updated if cn_source changed
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 2 Dec 2019 13:32:09 +0000 (14:32 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 23 Mar 2020 09:26:33 +0000 (09:26 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Item.pm

index cc4c772..65b5555 100644 (file)
@@ -77,8 +77,10 @@ sub store {
     }
 
     my %updated_columns = $self->_result->get_dirty_columns;
-    if ( exists $updated_columns{itemcallnumber} ) {
-        my $cn_sort = GetClassSort($self->cn_source, $self->itemcallnumber, "");
+    if (   exists $updated_columns{itemcallnumber}
+        or exists $updated_columns{cn_source} )
+    {
+        my $cn_sort = GetClassSort( $self->cn_source, $self->itemcallnumber, "" );
         $self->cn_sort($cn_sort);
     }