Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

bump psych

ulferts6b594e498c63
diff --git a/Gemfile.lock b/Gemfile.lock
index caceb8cce98..45b4c47c892 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -719,7 +719,7 @@ GEM
pry-stack_explorer (0.6.1)
binding_of_caller (~> 1.0)
pry (~> 0.13)
- psych (4.0.4)
+ psych (4.0.6)
stringio
public_suffix (5.0.0)
puffing-billy (3.0.4)
diff --git a/app/models/custom_actions/actions/serializer.rb b/app/models/custom_actions/actions/serializer.rb
index 8184d7f5f8d..2a4e86b2dc3 100644
--- a/app/models/custom_actions/actions/serializer.rb
+++ b/app/models/custom_actions/actions/serializer.rb
@@ -33,7 +33,7 @@ module CustomActions::Actions::Serializer
return [] unless value
YAML
- .safe_load(value, permitted_classes: [Symbol])
+ .safe_load(value, permitted_classes: [Symbol, Date])
.map do |key, values|
klass = nil
diff --git a/app/models/queries/work_packages/filter_serializer.rb b/app/models/queries/work_packages/filter_serializer.rb
index cce9ed36773..70b9abaf076 100644
--- a/app/models/queries/work_packages/filter_serializer.rb
+++ b/app/models/queries/work_packages/filter_serializer.rb
@@ -37,7 +37,7 @@ module Queries::WorkPackages::FilterSerializer
yaml = serialized_filter_hash
.gsub('!ruby/object:Syck::DefaultKey {}', '"="')
- (YAML.load(yaml) || {}).each_with_object([]) do |(field, options), array|
+ (YAML.load(yaml, permitted_classes: [Symbol, Date]) || {}).each_with_object([]) do |(field, options), array|
options = options.with_indifferent_access
filter = filter_for(field, no_memoization: true)
filter.operator = options['operator']
diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rb
index e0bb19bfe9f..9db59465e77 100644
--- a/config/constants/settings/definition.rb
+++ b/config/constants/settings/definition.rb
@@ -89,6 +89,8 @@ module Settings
if format == :hash
self.value = {} if value.nil?
value.deep_merge! other_value.deep_stringify_keys
+ elsif format == :datetime && !other_value.is_a?(DateTime)
+ self.value = DateTime.parse(other_value)
else
self.value = other_value
end
diff --git a/spec/constants/settings/definition_spec.rb b/spec/constants/settings/definition_spec.rb
index 5adb44ead16..098ff0c3afc 100644
--- a/spec/constants/settings/definition_spec.rb
+++ b/spec/constants/settings/definition_spec.rb
@@ -156,11 +156,11 @@ describe Settings::Definition do
.to be false
end
- it 'overriding date configuration from ENV will cast the value' do
+ it 'overriding datetime configuration from ENV will cast the value' do
stub_const('ENV', { 'OPENPROJECT_CONSENT__TIME' => '2222-01-01' })
expect(all.detect { |d| d.name == 'consent_time' }.value)
- .to eql Date.parse('2222-01-01')
+ .to eql DateTime.parse('2222-01-01')
end
it 'overriding configuration from ENV will set it to non writable' do