Skip to content

Url rewrites are all removed when mass updating visibility on store view when set to not visible indivudually. #34937

Closed
@leonhelmus

Description

@leonhelmus

Preconditions (*)

  1. php 7.4
  2. composer 1
  3. Magento version 2.4.2 enterprise
  4. RabbitMQ

Steps to reproduce (*)

  1. Have a multi store website (2-5 store views)
  2. Create a product that's connected to all stores make sure attribute code: visibility is on catalog,search
  3. Now go to backend Catalog -> Product. Select the created product and use the action update attributes.
  4. Now select a specific store view after change the attribute code: visibility to Not Visible Individually
  5. Now click on Save.

Expected result (*)

  1. Only the urls of the specific store for the specific product should be deleted in the url_rewrite table.

Actual result (*)

  1. ALL urls are removed of the specific product in the url_rewrite table and Admin UI - Marketing - URL Rewrites page

What my two cents tells me what it is.
I have debugged the issue and found out that the following observer does not take into account that the mass action can be done on store level (see

'global' => ScopedAttributeInterface::SCOPE_STORE,
). If you look in these two classes you see that it does not take into account that the user could change the visibility on store view. See these two classes:

While it does take account for the global way it does not take account that it can be set on store view. When you look at the dispatch of the event:

It does pass a store id. I think the store level should be taken into account to resolve this issue.

I believe this is a S1 problem there are workarounds by changing it in the database or changing everything manual but it's a lot of work to fix. And this could give merchant problems with their SEO while they are not aware of it.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Area: SEOArea: SearchComponent: DBComponent: UrlRewriteIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReported on 2.4.2Indicates 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

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions