Skip to content

Commit ad7cf72

Browse files
committed
Merge remote-tracking branch 'origin/1.7' into 2.0
2 parents bd053b8 + 3517e6f commit ad7cf72

File tree

8 files changed

+74
-9
lines changed

8 files changed

+74
-9
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

public/css/icons.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,10 @@
10211021
background: url(/bundles/pimcoreadmin/img/flat-color-icons/cell_phone_landscape.svg) center center no-repeat !important;
10221022
}
10231023

1024+
.pimcore_icon_systemrequirements {
1025+
background: url(/bundles/pimcoreadmin/img/flat-color-icons/factory.svg) center center no-repeat !important;
1026+
}
1027+
10241028
.pimcore_icon_notes {
10251029
background: url(/bundles/pimcoreadmin/img/flat-color-icons/survey.svg) center center no-repeat !important;
10261030
}

public/js/pimcore/element/helpers/gridColumnConfig.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ pimcore.element.helpers.gridColumnConfig = {
433433
containerType: "filterByRelationWindow"
434434
});
435435

436+
editor.fieldConfig.width = 300;
437+
436438
const formPanel = Ext.create('Ext.form.Panel', {
437439
xtype: "form",
438440
border: false,

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;
@@ -1456,9 +1457,14 @@ private function getResponseByScanStatus(Asset\Document $asset, bool $processBac
14561457
if ($scanStatus === null) {
14571458
$scanStatus = Asset\Enum\PdfScanStatus::IN_PROGRESS;
14581459
if ($processBackground) {
1459-
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
1460-
new AssetUpdateTasksMessage($asset->getId())
1461-
);
1460+
if (is_callable([$asset, 'addToUpdateTaskQueue'])) {
1461+
$asset->addToUpdateTaskQueue();
1462+
} else {
1463+
// Todo: BC layer, remove with 3.0 release
1464+
\Pimcore::getContainer()->get('messenger.bus.pimcore-core')->dispatch(
1465+
new AssetUpdateTasksMessage($asset->getId())
1466+
);
1467+
}
14621468
}
14631469
}
14641470

src/Controller/Admin/DataObject/ClassificationstoreController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ public function onKernelControllerEvent(ControllerEvent $event): void
14561456
'addCollectionsAction',
14571457
'searchRelationsAction',
14581458
];
1459-
$this->checkActionPermission($event, 'classes', $unrestrictedActions);
1459+
$this->checkActionPermission($event, 'classificationstore', $unrestrictedActions);
14601460
}
14611461

14621462
/**

src/Controller/Admin/Document/LinkController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,24 @@ protected function setValuesToDocument(Request $request, Document $document): vo
116116

117117
if (!$target) {
118118
if ($target = Document::getByPath($path)) {
119-
$data['linktype'] = 'internal';
120119
$data['internalType'] = 'document';
121120
$data['internal'] = $target->getId();
122121
} elseif ($target = Asset::getByPath($path)) {
123-
$data['linktype'] = 'internal';
124122
$data['internalType'] = 'asset';
125123
$data['internal'] = $target->getId();
126124
} elseif ($target = Concrete::getByPath($path)) {
127-
$data['linktype'] = 'internal';
128125
$data['internalType'] = 'object';
129126
$data['internal'] = $target->getId();
130127
} else {
131128
$data['linktype'] = 'direct';
132129
$data['internalType'] = null;
130+
$data['internal'] = null;
133131
$data['direct'] = $path;
134132
}
135133

136134
if ($target) {
137135
$data['linktype'] = 'internal';
136+
$data['direct'] = '';
138137
}
139138
}
140139
} else {

src/DependencyInjection/PimcoreAdminExtension.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313

1414
namespace Pimcore\Bundle\AdminBundle\DependencyInjection;
1515

16+
use Pimcore;
1617
use Pimcore\Bundle\CoreBundle\DependencyInjection\ConfigurationHelper;
18+
use Pimcore\Bundle\SimpleBackendSearchBundle\PimcoreSimpleBackendSearchBundle;
1719
use Pimcore\Config\LocationAwareConfigRepository;
1820
use Symfony\Component\Config\FileLocator;
1921
use Symfony\Component\DependencyInjection\ContainerBuilder;
2022
use Symfony\Component\DependencyInjection\Extension\Extension;
2123
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
2224
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
25+
use Symfony\Component\Yaml\Yaml;
2326

2427
/**
2528
* @internal
@@ -48,6 +51,34 @@ public function load(array $configs, ContainerBuilder $container): void
4851
$loader->load('event_listeners.yaml');
4952
$loader->load('export.yaml');
5053

54+
// Check if PimcoreSimpleBackendSearchBundle is installed and load to replace the search data provider services
55+
try {
56+
$bundle = Pimcore::getKernel()->getBundle('PimcoreSimpleBackendSearchBundle');
57+
$configFile = $bundle->getPath() . '/config/admin-classic.yaml';
58+
59+
$yaml = Yaml::parseFile($configFile);
60+
61+
$tmpFile = tempnam(sys_get_temp_dir(), 'services_');
62+
63+
try {
64+
file_put_contents(
65+
$tmpFile,
66+
Yaml::dump(['services' => $yaml['services']])
67+
);
68+
69+
$loader = new YamlFileLoader($container, new FileLocator(dirname($tmpFile)));
70+
71+
$loader->load(basename($configFile));
72+
} finally {
73+
if (is_file($tmpFile)) {
74+
unlink($tmpFile);
75+
}
76+
}
77+
} catch (\Exception $e) {
78+
// no simple backend search bundle installed
79+
}
80+
81+
// Merge
5182
//Set Config for GDPR data providers to container parameters
5283
$container->setParameter('pimcore.gdpr-data-extrator.dataobjects', $config['gdpr_data_extractor']['dataObjects']);
5384
$container->setParameter('pimcore.gdpr-data-extrator.assets', $config['gdpr_data_extractor']['assets']);

src/Service/GridData/DataObject.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ public static function getData(AbstractObject $object, ?array $fields = null, ?s
169169
) {
170170
$data[$dataKey . '%options'] = $def->getOptions();
171171
}
172+
173+
// to prevent malforded grids in case of empty fieldcollections
174+
if ($def instanceof ClassDefinition\Data\Fieldcollections) {
175+
$data[$dataKey] ??= '';
176+
}
172177
}
173178
} else {
174179
$data[$dataKey] = $valueObject->value;
@@ -351,7 +356,16 @@ protected static function getInheritedData(Concrete $object, string $key, string
351356
}
352357

353358
$inheritedValue = self::getStoreValueForObject($parent, $key, $requestedLanguage);
354-
if ((!is_array($inheritedValue) && $inheritedValue !== null) || !empty($inheritedValue['value'])) {
359+
if (
360+
(!is_array($inheritedValue) && $inheritedValue !== null) ||
361+
(
362+
is_array($inheritedValue) &&
363+
(
364+
array_is_list($inheritedValue) || //for table field types
365+
!empty($inheritedValue['value'] ?? null)
366+
)
367+
)
368+
) {
355369
return [
356370
'parent' => $parent,
357371
'value' => $inheritedValue,

0 commit comments

Comments
 (0)