Skip to content

Commit 3f7e4b7

Browse files
committed
Merge branch 'hotfix/gactions2' into 'feature/2.2.0'
Fix gactions See merge request metamodels/attribute_translatedfile!32
2 parents 5e8f00d + 8dd2e7d commit 3f7e4b7

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.check-author.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ ignore:
33

44
exclude:
55
- /^src\/Resources\/contao\/languages/
6+
7+
mapping:
8+
"Ingolf Steinhardt <info@e-spin.de>":
9+
- "Ingolf Steinhardt <git@e-spin.de>"

src/Attribute/TranslatedFile.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,29 +226,29 @@ protected function getWhere($mixIds, $mixLangCode = '')
226226
private function addWhere(QueryBuilder $builder, $mixIds, $table, $mixLangCode = ''): void
227227
{
228228
$builder
229-
->andWhere($builder->expr()->eq( $table . '.att_id', ':attributeID'))
229+
->andWhere($builder->expr()->eq($table . '.att_id', ':attributeID'))
230230
->setParameter(':attributeID', $this->get('id'));
231231

232232
if (!empty($mixIds)) {
233233
if (\is_array($mixIds)) {
234234
$builder
235-
->andWhere($builder->expr()->in( $table . '.item_id', ':itemIDs'))
235+
->andWhere($builder->expr()->in($table . '.item_id', ':itemIDs'))
236236
->setParameter('itemIDs', \array_map('intval', $mixIds), Connection::PARAM_INT_ARRAY);
237237
} else {
238238
$builder
239-
->andWhere($builder->expr()->eq( $table . '.item_id', ':itemID'))
239+
->andWhere($builder->expr()->eq($table . '.item_id', ':itemID'))
240240
->setParameter('itemID', $mixIds);
241241
}
242242
}
243243

244244
if (!empty($mixLangCode)) {
245245
if (\is_array($mixLangCode)) {
246246
$builder
247-
->andWhere($builder->expr()->in( $table . '.langcode', ':langcodes'))
247+
->andWhere($builder->expr()->in($table . '.langcode', ':langcodes'))
248248
->setParameter('langcodes', \array_map('strval', $mixLangCode), Connection::PARAM_STR_ARRAY);
249249
} else {
250250
$builder
251-
->andWhere($builder->expr()->eq( $table . '.langcode', ':langcode'))
251+
->andWhere($builder->expr()->eq($table . '.langcode', ':langcode'))
252252
->setParameter('langcode', $mixLangCode);
253253
}
254254
}
@@ -258,6 +258,9 @@ private function addWhere(QueryBuilder $builder, $mixIds, $table, $mixLangCode =
258258
* {@inheritdoc}
259259
*
260260
* @throws \InvalidArgumentException If no binary in value throw invalid exception.
261+
*
262+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
263+
* @SuppressWarnings(PHPMD.NPathComplexity)
261264
*/
262265
protected function prepareTemplate(Template $template, $rowData, $settings)
263266
{
@@ -266,7 +269,7 @@ protected function prepareTemplate(Template $template, $rowData, $settings)
266269
$value = $rowData[$this->getColName()]['value'];
267270

268271
// No data and show image, check placeholder.
269-
if (!$value['bin'] ?? null) {
272+
if (!($value['bin'] ?? null)) {
270273
if (null === $settings->get('file_showImage')
271274
|| null === ($placeholder = $settings->get('file_placeholder'))) {
272275
$template->files = [];
@@ -275,7 +278,7 @@ protected function prepareTemplate(Template $template, $rowData, $settings)
275278
return;
276279
}
277280

278-
$value['bin'][] = $placeholder;
281+
$value['bin'][] = $placeholder;
279282
$value['value'][] = StringUtil::binToUuid($placeholder);
280283
}
281284

0 commit comments

Comments
 (0)