Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting CMS page via webapi/cron should remove related URL rewrites #14751

Merged

Conversation

unicoder88
Copy link
Contributor

Preconditions

  1. Magento 2.2.3 Commerse edition - but any 2.2, I just have a fresh EE install to prove
  2. Apache/2.4.27 (Ubuntu)
  3. PHP 7.0.26-2+ubuntu17.10.1+deb.sury.org+2

Steps to reproduce

  1. Create new access token
  • System > Integrations > Add New Integration
  • set any name, give access to API resources Content > Elements > Pages https://prnt.sc/j6rek2, save
  • Click Activate > Allow on new integration, copy access token https://prnt.sc/j6reuq
  1. We want to delete CMS page 'About US' https://prnt.sc/j6rf4o and free url_rewrite about-us. Check url_rewrite table has a record before deleting.
  2. Make a REST API call DELETE http://m22ee.local/rest/V1/cmsPage/8, supply Authorization: Bearer {token} header. https://prnt.sc/j6rfk3
  3. Check that the page is gone in admin https://prnt.sc/j6rfr3
  4. Now check url_rewrite table. Old rewrite is not deleted https://prnt.sc/j6rfe3.
  5. Now try to create a new CMS page with identifier about-us that should have become available. You get an error https://prnt.sc/j6rfyz.

Expected result

  1. After deleting CMS page via API or in crontab area, according URL rewrites should be removed.

Actual result

  1. Module Magento_CmsUrlRewrite declares plugin cms_url_rewrite_plugin only in adminhtml area, this should be moved to global area.
    https://prnt.sc/j6rgtj

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Apr 18, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

@unicoder88 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@orlangur orlangur self-assigned this Apr 18, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-1314 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @unicoder88. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants