fix(project-management) : skip caldav sync when unconfigured and require task project
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user