Skip to content

The grid’s Default View dropdown is showing as blank #38536

Open
@lubnaboghara

Description

@lubnaboghara

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
image

Screenshot 2: After refreshing the page
image

Steps to reproduce (*)

  1. Access the Magento admin panel and navigate to any grid.
  2. Navigate to the "Columns" section and select or deselect any field.
  3. Click on the default view dropdown menu and then select the "Save View As..." option.
  4. Name the view as 'filter' and then press Enter. You may notice that it does not appear in the dropdown menu.
  5. Subsequently, after refreshing the page, all the views disappear.

Screenshot 3:
image

Screenshot 4:
image

Screenshot 5:
image

Screenshot 6:
image

Expected result (*)

  1. Naming a view as ‘filter’ should not cause any issue and should show the default view dropdown correctly.

Actual result (*)

  1. 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.

Screenshot 7:
image

Screenshot 8:
test

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Admin UIComponent: AdminIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.6Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions