fix(project-management) : skip caldav sync when unconfigured and require task project

This commit is contained in:
Matthieu
2026-06-22 09:05:16 +02:00
parent a76facbf4c
commit 987df54175
2 changed files with 7 additions and 0 deletions
@@ -111,6 +111,7 @@ class Task implements TaskInterface, TimestampableInterface, BlamableInterface
#[ORM\ManyToOne(targetEntity: Project::class, inversedBy: 'tasks')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
#[Groups(['task:read', 'task:write'])]
#[Assert\NotNull]
private ?Project $project = null;
/** @var Collection<int, TaskTag> */
@@ -134,6 +134,12 @@ final class CalDavService
public function syncTask(Task $task): void
{
// No CalDAV server configured/enabled: skip all remote interaction so a
// task save never triggers a doomed HTTP request nor stores a sync error.
if (!$this->isConfigured()) {
return;
}
if (!$task->isSyncToCalendar()) {
$this->deleteEvent($task->getCalendarEventUid());
$this->deleteTodo($task->getCalendarTodoUid());