Query all runs when no status has been added
[MAILPOET-5514]
This commit is contained in:
@@ -134,11 +134,18 @@ class AutomationRunStorage {
|
||||
}
|
||||
|
||||
public function getCountForAutomation(Automation $automation, string ...$status): int {
|
||||
$table = esc_sql($this->table);
|
||||
|
||||
if (!count($status)) {
|
||||
return 0;
|
||||
$query = (string)$this->wpdb->prepare("
|
||||
SELECT COUNT(id) as count
|
||||
FROM $table
|
||||
WHERE automation_id = %d
|
||||
", $automation->getId());
|
||||
$result = $this->wpdb->get_col($query);
|
||||
return $result ? (int)current($result) : 0;
|
||||
}
|
||||
|
||||
$table = esc_sql($this->table);
|
||||
$statusSql = (string)$this->wpdb->prepare(implode(',', array_fill(0, count($status), '%s')), ...$status);
|
||||
$query = (string)$this->wpdb->prepare("
|
||||
SELECT COUNT(id) as count
|
||||
|
@@ -44,7 +44,7 @@ parameters:
|
||||
- '/Call to method getName\(\) on an unknown class _generated\\([a-zA-Z])*Cookie/' # codeception generate incorrect return type in ../../tests/_support/_generated
|
||||
-
|
||||
message: "#^Cannot cast string|void to string\\.$#"
|
||||
count: 10
|
||||
count: 11
|
||||
path: ../../lib/Automation/Engine/Storage/AutomationRunStorage.php
|
||||
-
|
||||
message: "#^Cannot cast string|void to string\\.$#"
|
||||
|
Reference in New Issue
Block a user