[Grid Options] Fixes for saving grid configuration with "save filters" #963
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps to reproduce bug:
Expected behaviours:
Actual behaviour:
Reasoning:
admin-ui-classic-bundle/public/js/pimcore/object/folder/search.js
Lines 341 to 346 in 7bf40f8
This applies the saved filters to the store. But there is no connection to the column filters here. For this reason, the filters get applied but not shown in the column filters. Instead the [ExtJS docs](https://docs.sencha.com/extjs/7.4.0/classic/ Ext.grid.filters.Filters.html) suggest:
With this approach the preset value gets applied to the column filter and thus as well to the store.
The reason why the checkbox was not saved surprised me very much: Although the
Dao
object containssetSaveFilters()
andgetSaveFilters()
, the database tablegridconfigs
is missing a corresponding column. When saving the grid config inadmin-ui-classic-bundle/src/Controller/Admin/DataObject/DataObjectHelperController.php
Line 872 in 7bf40f8
The value for
saveFilters
column gets set.In
admin-ui-classic-bundle/src/Controller/Admin/DataObject/DataObjectHelperController.php
Line 877 in 7bf40f8
the grid config is tried to be saved. But as there is no column for this field in
admin-ui-classic-bundle/src/Model/GridConfig/Dao.php
Line 51 in 7bf40f8
it gets simply ignored.
As the
admin-ui-classic
bundle does not have any migrations, I have added this in [Grid Options] Add column for "saveFilters" checkbox in saved grid configs pimcore#18528.This PR fixes this. Additionally it adds a translation for
Save filters
checkbox label which was hard-coded before.