Skip to content

Commit

Permalink
fix(common): better search for ticket validation
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Dec 31, 2020
1 parent 28a847f commit e7bbdcc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions inc/common.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,17 @@ public static function cancelMyTicket(int $id) : bool {
* @return array
*/
public static function getTicketStatusForIssue(Ticket $item) : array {
$ticketValidation = new TicketValidation();
$ticketValidation->getFromDBByCrit([
$ticketValidations = (new TicketValidation())->find([
'tickets_id' => $item->getID(),
]);
], [
'timeline_position ASC'
], 1);
$ticketValidation = new TicketValidation();
if (count($ticketValidations)) {
$row = array_shift($ticketValidation);
$ticketValidation->getFromDB($row['id']);
}

$status = $item->fields['status'];
$user = 0;
if (!$ticketValidation->isNewItem()) {
Expand Down

2 comments on commit e7bbdcc

@bazingavp
Copy link

@bazingavp bazingavp commented on e7bbdcc Jan 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonjour,
Il me semble qu'il manque un "s" à la variable, ligne 275 : $row = array_shift($ticketValidations);
Bonne journée

@btry
Copy link
Collaborator Author

@btry btry commented on e7bbdcc Jan 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonjour

Oui, c'est vrai. ça a été corrigé il y a quelques jours. Il doit y avoir un commit dans la branche support/2.10.0, si vous utilisez une version de cette série.

Please sign in to comment.