stable

Clone or download

Read-only

fix: CalendarEventDataBuilder should check timeframe fields are set to zero

Part of story #35094 have "calendar" events attached to tracker email notification The builder allow start_date and end_date to be set to 0 to cancel an event (an error is raised only if one of it is set to 0). When timeframe is built on duration, if duration is set to 0 end_date will be set to null. So the check of the builder fail and an error is raised for start_date set to 0. To avoid that we not check start_date and end_date but the fields value through the timeframe calculator. *Testing:* With a tracker with a timeframe based on duration, create an artifact with the 2 fields set to non zero values. You will receive a mail with an event. Then update the artifact by clearing the 2 fields. You should receive a mail with a canceled event. Change-Id: I23c501dae31cded9f012bfc37abd1494b917ffb8

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Changeset/PostCreation/CalendarEvent/CalendarEventDataBuilder.php +6 −5 Go to diff View file
M plugins/tracker/include/Tracker/Semantic/Timeframe/IComputeTimeframes.php +2 −0 Go to diff View file
M plugins/tracker/include/Tracker/Semantic/Timeframe/TimeframeImpliedFromAnotherTracker.php +7 −0 Go to diff View file
M plugins/tracker/include/Tracker/Semantic/Timeframe/TimeframeNotConfigured.php +5 −0 Go to diff View file
M plugins/tracker/include/Tracker/Semantic/Timeframe/TimeframeWithDuration.php +17 −0 Go to diff View file
M plugins/tracker/include/Tracker/Semantic/Timeframe/TimeframeWithEndDate.php +17 −0 Go to diff View file
M plugins/tracker/include/Tracker/Semantic/TimeframeConfigInvalid.php +5 −0 Go to diff View file
M plugins/tracker/tests/unit/Stub/Semantic/Timeframe/IComputeTimeframesStub.php +7 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Changeset/PostCreation/CalendarEvent/CalendarEventDataBuilderTest.php +36 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Semantic/Timeframe/TimeframeWithDurationTest.php +54 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Semantic/Timeframe/TimeframeWithEndDateTest.php +75 −0 Go to diff View file