Skip to content

Commit 1798225

Browse files
committed
Merge remote-tracking branch 'origin/2.1' into 2.x
2 parents 4894877 + 5cacd10 commit 1798225

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

phpstan-baseline.neon

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@ parameters:
33
-
44
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(mixed\\)\\: bool\\)\\|null, 'intval' given\\.$#"
55
count: 1
6-
path: src/Controller/Admin/DataObject/ClassificationstoreController.php
6+
path: src/Controller/Admin/DataObject/ClassificationstoreController.php
7+
-
8+
message: "#^Call to protected method addToUpdateTaskQueue\\(\\) of class Pimcore\\\\Model\\\\Asset\\.$#"
9+
count: 1
10+
path: src/Controller/Admin/Asset/AssetController.php
11+
12+
-
13+
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
14+
count: 1
15+
path: src/Controller/Admin/Asset/AssetController.php

src/Controller/Admin/Asset/AssetController.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace Pimcore\Bundle\AdminBundle\Controller\Admin\Asset;
1414

15+
use function is_callable;
1516
use Pimcore\Bundle\AdminBundle\Controller\Admin\ElementControllerBase;
1617
use Pimcore\Bundle\AdminBundle\Controller\Traits\AdminStyleTrait;
1718
use Pimcore\Bundle\AdminBundle\Controller\Traits\ApplySchedulerDataTrait;
@@ -1445,9 +1446,14 @@ private function getResponseByScanStatus(Asset\Document $asset, bool $processBac
14451446
if ($scanStatus === null) {
14461447
$scanStatus = Asset\Enum\PdfScanStatus::IN_PROGRESS;
14471448
if ($processBackground) {
1448-
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
1449-
new AssetUpdateTasksMessage($asset->getId())
1450-
);
1449+
if (is_callable([$asset, 'addToUpdateTaskQueue'])) {
1450+
$asset->addToUpdateTaskQueue();
1451+
} else {
1452+
// Todo: BC layer, remove with 3.0 release
1453+
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
1454+
new AssetUpdateTasksMessage($asset->getId())
1455+
);
1456+
}
14511457
}
14521458
}
14531459

0 commit comments

Comments
 (0)