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

Fix #10764: delete url rewrites for products after an attribute set is deleted #11391

Closed
wants to merge 1,155 commits into from
Closed

Fix #10764: delete url rewrites for products after an attribute set is deleted #11391

wants to merge 1,155 commits into from

Conversation

patrikpihlstrom
Copy link

Description

Adds an interceptor around the delete function of \Magento\Eav\Model\AttributeSetRepository in order to capture the relevant product ids, and then remove the old url rewrites after the attribute set has been deleted.

Fixed Issues (if relevant)

  1. Delete Attribute Set is not Deleting product url key in url rewrite #10764: Delete Attribute Set is not Deleting product url key in url rewrite

Manual testing scenarios

  1. Create an attribute set
  2. Create a product from the newly created attribute set and insure that a url key is specified
  3. Delete the attribute set
  4. Create a new product from the default attribute set and apply the same url key
  5. Hopefully you won't get an error when you save the product

@patrikpihlstrom patrikpihlstrom changed the title delete url rewrites for products after an attribute set is deleted Fix #10764: delete url rewrites for products after an attribute set is deleted Oct 11, 2017
@vrann vrann self-assigned this Oct 24, 2017
@vrann vrann added this to the October 2017 milestone Oct 24, 2017
vrann
vrann previously requested changes Oct 25, 2017
* Time: 22:12
*/

namespace Magento\CatalogUrlRewrite\Plugin\Eav\Model;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the namespace. Here is the test result:

Passed: 24399, Failed: 1, Incomplete: 0, Skipped: 0.
Data set: /opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/app/code/Magento/CatalogUrlRewrite/Plugin/Eav/Model/AttributeSetRepository.php
Incorrect namespace usage(s) found in file /opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/app/code/Magento/CatalogUrlRewrite/Plugin/Eav/Model/AttributeSetRepository.php:
CouldNotDeleteException
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php:598
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php:371
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/lib/internal/Magento/Framework/App/Utility/AggregateInvoker.php:56
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php:373

/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/lib/internal/Magento/Framework/App/Utility/AggregateInvoker.php:115
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/lib/internal/Magento/Framework/App/Utility/AggregateInvoker.php:70
/opt/bamboo/bamboo-agent-home/xml-data/build-dir/MCCE22-AT398-INSE/magento2ce/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php:373```

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what the namespace is supposed to be if not Magento\CatalogUrlRewrite\Plugin\Eav\Model. I've copied the namespace structure from other plugins, for example Magento\Catalog\Plugin\Model\ResourceModel.

callable $proceed,
AttributeSetInterface $attributeSet
) {
if (!isset($subject) || !$attributeSet->getAttributeSetId())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the coding style

Magento\Test\Php\LiveCodeTest::testCodeStyle
PHP Code Sniffer detected 2 violation(s): 

FILE: ...to/CatalogUrlRewrite/Plugin/Eav/Model/AttributeSetRepository.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 50 | ERROR | [x] Expected 1 space after closing parenthesis; found 9
----------------------------------------------------------------------

@vrann
Copy link
Contributor

vrann commented Oct 25, 2017

@patrikpihlstrom please make needed changes in order to accept the PR

Oleksii Korshenko and others added 15 commits November 10, 2017 13:14
…stomer Dashboard by default #11876

 - Merge Pull Request #11876 from p-bystritsky/magento2:ISSUE-10834
 - Merged commits:
   1. fe1b4b1
   2. 72babf2
   3. 8e4bd2c
   4. c50899e
Public Pull Requests

#12136 update button.phtml overcomplicated translation phrase. 2.2 by @ChuckyK
#12061 Cleanup for object manager references and depricated method by @atishgoswami
#11968 Fix bug: Customer import deletes exiting customer entity Fields by @jalogut
#11459 close #10810 Migrates Apache Access Syntax to 2.4 on Apache >= 2.4 by @jonashrem

Fixed Public Issues

#10810 Add support of apache2.4 commands in htaccess
Public Pull Requests

#11876 After logging in customer is now not redirecting to Customer Dashboard by default by @p-bystritsky

Fixed Public Issues

#10834 signing in after selecting checkout button, will not end up to checkout page!
… - spike

- Merge branch '2.2-develop' into bugfixes
ishakhsuvarov and others added 17 commits November 24, 2017 09:45
…t in XML #9413 #11473

 - Merge Pull Request #11473 from mariuscris/magento2:issue-9413
 - Merged commits:
   1. 42072dd
   2. 9dbe444
   3. 49fdfae
   4. b6ed2d9
   5. 9cd20c0
   6. 2adefdf
   7. cbda7b8
   8. 992b3a1
   9. 4e937a3
   10. c303e4d
   11. cd7dc56
   12. 6162464
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-83552: save invoice ID on credit memo when using API method salesRefundInvoiceV1 #11670
 - MAGETWO-82577: [Backport 2.2] Translate order getCreatedAtFormatted() to store locale #11422
 - MAGETWO-84474: 10128: New Orders not being saved to order grid #12241
 - MAGETWO-83783: Shipping method fixtures not compatible with getShippingMethod(true) in OrderCreateTest #12227
 - MAGETWO-83290: Add swatch option: Prevent loosing data and default value if data is not populated via adminhtml #12036
 - MAGETWO-83741: 11740: Sending emails from Admin in Multi-Store Environment defaults to Primary Store #11992
 - MAGETWO-83399: Fix for remove 'product_list_toolbar' block from layout in XML #9413 #11473
 - Merge Pull Request magento-engcom/magento2ce#903 from RomaKis/magento2:9515
 - Merged commits:
   1. 97d449c
   2. 5c3d295
…invoice_set_template_vars_before Event (backport MAGETWO-69482 to 2.2) #12132
 - Merge Pull Request #11389 from manuelson/magento2:feature/11341
 - Merged commits:
   1. c33d9d7
Public Pull Requests

#1770 9515: South Korea Zip Code Validation incorrect by @RomaKis
#12132 10210: Transport variable can not be altered in email_invoice_set_template_vars_before Event (backport MAGETWO-69482 to 2.2) by @RomaKis

Fixed Public Issues

#9515 South Korea Zip Code Validation incorrect
#10210 Transport variable can not be altered in email_invoice_set_template_vars_before Event
…ted #9742 #12328

 - Merge Pull Request #12328 from RomaKis/magento2:9742
 - Merged commits:
   1. 147f638
…coded properly in admin attribute option input fields #12133
Public Pull Requests

#12328 9742: Default welcome message returns after being deleted #9742 by @RomaKis
#12253 New validation: 3bytes characters filter (4 bytes characters cannot be stored using UTF8) by @KarlDeux
#12133 Fix for issue 12127: Single quotation marks are now decoded properly in admin attribute option input fields by @erfanimani
#11389 Attribute category_ids issue by @manuelson

Fixed Public Issues

#9742 Default welcome message returns after being deleted
#12058 Can't save emoji in custom product options
#12127 Apostrophe in attribute option value in admin is not handled properly
#11341 Attribute category_ids issue
@okorshenko okorshenko assigned okorshenko and unassigned vrann Nov 29, 2017
Oleksii Korshenko added 3 commits November 29, 2017 16:58
…attribute set is deleted #11391

 - Merge Pull Request #11391 from patrikpihlstrom/magento2:delete-url-rewrites
 - Merged commits:
   1. 284f966
   2. 07a95cc
   3. 58b9536
   4. 5ff6b67
   5. 4b95a11
…attribute set is deleted #11391

 - fixed static tests
…attribute set is deleted #11391

 - fixed plugin logic
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Nov 30, 2017

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
6 out of 13 committers have signed the CLA.

✅ okorshenko
✅ vkublytskyi
✅ andrew-garside-temando
✅ ishakhsuvarov
✅ dmanners
✅ RomaKis
❌ rossbrandon
❌ olysenko
❌ AlexMaxHorkun
❌ aakimov
❌ odubovyk
❌ interio
❌ dvoskoboinikov

@sidolov
Copy link
Contributor

sidolov commented Dec 7, 2017

Described issue resolved in #12167

@sidolov sidolov closed this Dec 7, 2017
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.