From be919d2bd78f09f082bf686d259268b67d54a948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Sat, 23 Nov 2024 11:02:17 +0100 Subject: [PATCH] Revision API issues #1564 --- app/models/dmsf_file_revision.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/dmsf_file_revision.rb b/app/models/dmsf_file_revision.rb index 9fc6783f..bb0c399b 100644 --- a/app/models/dmsf_file_revision.rb +++ b/app/models/dmsf_file_revision.rb @@ -416,6 +416,8 @@ class DmsfFileRevision < ApplicationRecord end # ActionParameters => Hash h = DmsfFileRevision.params_to_hash(values) + # From a REST API call we don't get "20" => "Project" but "CustomFieldValue20" => "Project" + h.transform_keys! { |key| key.to_i.zero? && key.to_s.match(/(\d+)/) ? :Regexp.last_match(0) : key } # Super self.custom_field_values = h # For a new revision we need to duplicate attachments