Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Fix flaky escalation test on solve/reject-solution data sets
- CI: fix Psalm cache directory, drop the stray `glpi-project/tools` composer dependency, declare a unique composer autoloader suffix
- Fix ticket status config being reset to default after each plugin update

## [2.10.8] 2026-09-11

Expand Down
10 changes: 8 additions & 2 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,14 @@ function plugin_escalade_install()
$DB->doQuery($query);
}

// Update for 0.84 status
if ($DB->tableExists('glpi_plugin_escalade_configs')) {
// Update for 0.84 status (only while `ticket_last_status` is still a VARCHAR, i.e. not yet migrated)
if (
$DB->tableExists('glpi_plugin_escalade_configs')
&& !str_starts_with(
strtolower($DB->listFields('glpi_plugin_escalade_configs')['ticket_last_status']['Type'] ?? 'int'),
'int',
)
) {
foreach ($DB->request(['FROM' => "glpi_plugin_escalade_configs"]) as $data) {
$status = match ($data['ticket_last_status']) {
'solved' => Ticket::SOLVED,
Expand Down
10 changes: 3 additions & 7 deletions tests/Units/GroupEscalationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,10 +949,7 @@ public function testHistory()
$this->assertEquals(1, count($history->find(['tickets_id' => $ticket->getID(), 'groups_id' => $group1->getID()])));
}

/**
* Test that the standard target "Group in charge of the ticket"
* sends notifications to users of both groups (old and new) during an escalation
*/
// The "Group in charge of the ticket" target only notifies the newly assigned group on escalation.
public function testStandardGroupNotification()
{
global $CFG_GLPI, $DB;
Expand Down Expand Up @@ -1046,11 +1043,10 @@ public function testStandardGroupNotification()
$notification_recipients[] = $notif['recipient'];
}

// Check that users from both groups received notifications
// Only the new group's users should be notified; the old group was removed.
$group1_user_emails = [$this->getItemEmail($user1), $this->getItemEmail($user2)];
$group2_user_emails = [$this->getItemEmail($user3), $this->getItemEmail($user4)];

// At least one user from each group should have received a notification
$group1_notified = false;
$group2_notified = false;

Expand All @@ -1068,7 +1064,7 @@ public function testStandardGroupNotification()
}
}

$this->assertTrue($group1_notified, "No user from the original group received a notification");
$this->assertFalse($group1_notified, "A user from the removed group should not receive a notification");
$this->assertTrue($group2_notified, "No user from the new group received a notification");
}

Expand Down
3 changes: 3 additions & 0 deletions tests/Units/TaskMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use Group_Ticket;
use PHPUnit\Framework\Attributes\DataProvider;
use Plugin;
use PluginEscaladeTicket;
use Ticket;
use Ticket_User;
use TicketTask;
Expand Down Expand Up @@ -193,6 +194,8 @@ public static function taskGroupEscalationProvider()
#[DataProvider('taskGroupEscalationProvider')]
public function testTaskGroupEscalation(array $conf)
{
// Status must stay managed by core, otherwise the ticket status change interferes with the solve/reject flow
$conf['ticket_last_status'] = PluginEscaladeTicket::MANAGED_BY_CORE;
$this->initConfig($conf);

$ticket = $this->createItem('Ticket', [
Expand Down
Loading