Description
Preconditions (*)
Tested on this versions:
1. Magento 2.4.6-p4
2. Magento 2.4-develop branch
Description (*)
When navigating to any grid page, such as the product or order grid, the user can create new views by selecting the 'Default view' dropdown menu. However, after creating a new view and naming it 'filter', it is saved in the database but not displayed in the dropdown menu. Additionally, upon refreshing the page, the entire view section becomes blank.
This issue triggers an error in the console, specifically a TypeError that states "number 0 is not a function."
Screenshot 1: Before refreshing the page
Screenshot 2: After refreshing the page
Steps to reproduce (*)
- Access the Magento admin panel and navigate to any grid.
- Navigate to the "Columns" section and select or deselect any field.
- Click on the default view dropdown menu and then select the "Save View As..." option.
- Name the view as 'filter' and then press Enter. You may notice that it does not appear in the dropdown menu.
- Subsequently, after refreshing the page, all the views disappear.
Expected result (*)
- Naming a view as ‘filter’ should not cause any issue and should show the default view dropdown correctly.
Actual result (*)
- Naming a view as 'filter' results in the default view dropdown showing as blank.
Additional information (*)
File path: vendor/magento/module-ui/view/base/web/js/lib/knockout/bindings/i18n.js
After debugging the issue, I discovered that, In the ‘execute’ function of the 18n.js file, it translates the text using ‘$.mage.__(original)’. Therefore, when naming the view as ‘filter’, it converts it into the function ‘ ƒ filter() { [native code] } ‘.
In the ‘setText’ function, it sets the texts in the element, but it seems to be triggering an error. It's unclear why it's converting the word "filter" into a function.