Revision API issues #1564

This commit is contained in:
Karel Pičman 2024-11-23 11:02:17 +01:00
parent d5312aea06
commit be919d2bd7

View File

@ -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