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

handle no duration set on copying a work package

ulfertseb5fd5414277
diff --git a/app/services/work_packages/set_attributes_service.rb b/app/services/work_packages/set_attributes_service.rb
index 77afb91e0b6..72b35487cc7 100644
--- a/app/services/work_packages/set_attributes_service.rb
+++ b/app/services/work_packages/set_attributes_service.rb
@@ -303,6 +303,7 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
end
def date_changed_but_not_duration?
- (work_package.start_date_changed? || work_package.due_date_changed?) && !work_package.duration_changed?
+ (work_package.start_date_changed? || work_package.due_date_changed? || work_package.duration.nil?) &&
+ !work_package.duration_changed?
end
end