Skip to content

Commit

Permalink
[Bug]: Allow Objects settings saved wrong as array instead of comma s…
Browse files Browse the repository at this point in the history
…eparated list (#146)

* Fix: serialize on tree store

* Fix: serialize on tree store
  • Loading branch information
robertSt7 committed Sep 14, 2023
1 parent 14ee134 commit 575fec6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Resources/public/js/pimcore/perspective/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,16 @@ pimcore.bundle.perspectiveeditor.ViewEditor = class {
iconCls: "pimcore_icon_save",
disabled: !pimcore.settings['custom-views-writeable'],
handler: function(){
const serializedViews = this.viewTreeStore.getRoot().serialize();
for (let child of serializedViews.children) {
if (child.config.classes && Array.isArray(child.config.classes)) {
child.config.classes = child.config.classes.join(',');
}
}
Ext.Ajax.request({
url: this.routePrefix + '/update',
params: {
data: Ext.JSON.encode(this.viewTreeStore.getRoot().serialize()),
data: Ext.JSON.encode(serializedViews),
deletedRecords: Ext.JSON.encode(this.deletedRecords)
},
method: 'POST',
Expand Down Expand Up @@ -428,8 +434,11 @@ pimcore.bundle.perspectiveeditor.ViewEditor = class {
listeners: {
change: function(elem, newValue, oldValue){
if (newValue != null) {
data.config.classes = newValue.join(',');
this.setDirty(true);
const newClasses = newValue.join(',');
if(newClasses !== data.config.classes) {
data.config.classes = newClasses;
this.setDirty(true);
}
}
}.bind(this)
}
Expand Down

0 comments on commit 575fec6

Please sign in to comment.