Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.2' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Nov 5, 2024
2 parents 9ec75e0 + c3223f1 commit 82a567e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/FilterService/FilterType/MultiSelectCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function addCondition(AbstractFilterDefinitionType $filterDefinition, Pro
$category = $category->getId();
}

$category = '%,' . trim($category) . ',%';
$category = '%,' . trim((string)$category) . ',%';

$conditions[] = $filterDefinition->getField() . ' LIKE ' . $db->quote($category);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ pimcore.object.tags.indexFieldSelection = Class.create(pimcore.object.tags.selec
load: function(store) {
if(this.data) {
if(this.preSelectCombobox.rendered) {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.getPreselectValue());
} else {
this.preSelectCombobox.addListener("afterRender", function() {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.getPreselectValue());
}.bind(this));
}
}
Expand Down Expand Up @@ -239,10 +239,10 @@ pimcore.object.tags.indexFieldSelection = Class.create(pimcore.object.tags.selec

if(this.fieldConfig.multiPreSelect == 'local_single' || this.fieldConfig.multiPreSelect == 'local_multi') {
if(this.preSelectCombobox.rendered) {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.getPreselectValue());
} else {
this.preSelectCombobox.addListener("afterRender", function() {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.getPreselectValue());
}.bind(this));
}
}
Expand All @@ -262,5 +262,12 @@ pimcore.object.tags.indexFieldSelection = Class.create(pimcore.object.tags.selec

isDirty: function() {
return this.fieldsCombobox.isDirty() || (this.preSelectCombobox && this.preSelectCombobox.isDirty());
},

getPreselectValue: function() {
if(this.fieldConfig.filterGroups?.includes('relation')) {
return this.data.preSelect?.split(',').map(Number);
}
return this.data.preSelect?.split(',');
}
});

0 comments on commit 82a567e

Please sign in to comment.