Skip to content

Admin Global Search was build in a hurry #7698

@tzyganu

Description

@tzyganu

The admin global search is not entirely translatable, extensible and does not take into account the ACL settings for the current user

Preconditions

Installed Version: 2.2.0-dev

Steps to reproduce

  1. Install any other language pack
  2. Create an admin role that does not have access to orders and an admin user assigned to that role
  3. Login as the user created in the step above
  4. Search for something in the admin global search.

Expected result

  1. I should see the links to " keywords in Products", " keywords in Customers", " keywords in Pages" only and translated in the selected language.
  2. I should see results for products, pages and customers matching my keywords (this actually works).

Actual result

  1. I see the link "keywords in Orders" that I should not see because I don't have access to orders. Clicking it takes me to an "Access denied" page.
  2. The texts "in products", "in pages"... are not translated
    image

Additional information.

The actual results explained above happen because the template that displays the global search results contains the hardcoded values for the links to pages, customers, products and orders. (lines 30 to 41) and the texts "in products", "in pages" don't go through the translation function __.

Additional issues related to the global search.

The global search is partially extensible (without changing the template that renders the results).
I can add my own entity that can be searchable in the global search but I cannot add a link. For example if I have an entity called "Article", I can make the instances searchable but I cannot get a link saying "keywords in Articles" without changing the template.

Suggestion to make it extensible and to avoid ACL related issues.

The links "keywords in ..." should come from the di.xml file and have the ACL for those links checked before displaying the links. Similar to how the actual entity search works.

Metadata

Metadata

Assignees

Labels

Component: SearchComponent: TranslationFixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions