Skip to content

Commit

Permalink
bugfix : can't purge templates that are used
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurMinfotel committed Aug 7, 2024
1 parent 030bab3 commit 54de525
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
21 changes: 12 additions & 9 deletions inc/planningexternalevent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,17 +730,20 @@ static function prepareInputToAddWithPluginOptions(PlanningExternalEvent $item)

static function activityUpdate(PlanningExternalEvent $item)
{
if (!is_array($item->input) || !count($item->input)) {
// Already cancel by another plugin
return false;
}
// input isn't set when updated by cleanDBRelation
if (isset($item->input)) {
if (!is_array($item->input) || !count($item->input)) {
// Already cancel by another plugin
return false;
}

if (isset($_POST['action']) && $_POST['action'] == 'delete_event') {
return false;
}
if (isset($_POST['action']) && $_POST['action'] == 'delete_event') {
return false;
}

self::prepareInputToUpdateWithPluginOptions($item);
self::setActivity($item);
self::prepareInputToUpdateWithPluginOptions($item);
self::setActivity($item);
}
}

static function activityAdd(PlanningExternalEvent $item)
Expand Down
13 changes: 7 additions & 6 deletions inc/tickettask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ static function setTicketTask(TicketTask $item) {
}

static function taskUpdate(TicketTask $item) {

if (!is_array($item->input) || !count($item->input)) {
// Already cancel by another plugin
return false;
}
self::setTicketTask($item);
if (isset($item->input)) {
if (!is_array($item->input) || !count($item->input)) {
// Already cancel by another plugin
return false;
}
self::setTicketTask($item);
}
}

static function taskAdd(TicketTask $item) {
Expand Down

0 comments on commit 54de525

Please sign in to comment.