Skip to content

[BACKPORT] [TASK] Always setSaveRewritesHistory to 1 for API calls so there will… #18915

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

Conversation

lewisvoncken
Copy link
Contributor

@lewisvoncken lewisvoncken commented Oct 29, 2018

… be created a SEO rewrite for the old url

same as PR #18408

Description

Permanent Redirect for old URL missing via API

Fixed Issues (if relevant)

  1. Permanent Redirect for old URL missing via API or no documentation #16789: Permanent Redirect for old URL missing via API or no documentation

Manual testing scenarios

  1. Update a product by a PUT request through the REST API: V1/products/{sku}

{
  "product": {
  "id": 1,
  "sku": "{sku}",
  "name": "Test Product Default",
  "attribute_set_id": 4,
  "price": 10,
  "status": 1,
  "visibility": 4,
  "type_id": "simple",
  "created_at": "2018-10-05 19:07:16",
  "updated_at": "2018-10-05 19:07:45",
  "extension_attributes": {
    "website_ids": [
      1
    ],
    "stock_item": {
      "item_id": 1,
      "product_id": 1,
      "stock_id": 1,
      "qty": 0,
      "is_in_stock": false,
      "is_qty_decimal": false,
      "show_default_notification_message": false,
      "use_config_min_qty": true,
      "min_qty": 0,
      "use_config_min_sale_qty": 1,
      "min_sale_qty": 1,
      "use_config_max_sale_qty": true,
      "max_sale_qty": 10000,
      "use_config_backorders": true,
      "backorders": 0,
      "use_config_notify_stock_qty": true,
      "notify_stock_qty": 1,
      "use_config_qty_increments": true,
      "qty_increments": 0,
      "use_config_enable_qty_inc": true,
      "enable_qty_increments": false,
      "use_config_manage_stock": true,
      "manage_stock": true,
      "low_stock_date": "2018-10-05 19:07:45",
      "is_decimal_divided": false,
      "stock_status_changed_auto": 1
    }
  },
  "product_links": [],
  "options": [],
  "media_gallery_entries": [],
  "tier_prices": [],
  "custom_attributes": [
    {
      "attribute_code": "options_container",
      "value": "container2"
    },
    {
      "attribute_code": "url_key",
      "value": "test-product-default-new"
    },
    {
      "attribute_code": "gift_message_available",
      "value": "2"
    },
    {
      "attribute_code": "required_options",
      "value": "0"
    },
    {
      "attribute_code": "has_options",
      "value": "0"
    },
    {
      "attribute_code": "meta_title",
      "value": "Test Product Default"
    },
    {
      "attribute_code": "meta_keyword",
      "value": "Test Product Default"
    },
    {
      "attribute_code": "meta_description",
      "value": "Test Product Default "
    },
    {
      "attribute_code": "tax_class_id",
      "value": "2"
    },
    {
      "attribute_code": "category_ids",
      "value": []
    }
  ]
},
  "saveOptions": true
}

  1. Expected Result Product URL changes to domain/test-product-default-new
  2. Now when visiting the old url it should redirect to the new url but it shows a 404

Apply Changes and the URL Rewrite History will successfully be updated. See screenshots for more information:

Before:
image

Incorrect Result After Update Call:
image

After Fix:
image

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @lewisvoncken. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@lewisvoncken lewisvoncken changed the title [TASK] Always setSaveRewritesHistory to 1 for API calls so there will… [BACKPORT] [TASK] Always setSaveRewritesHistory to 1 for API calls so there will… Oct 29, 2018
@orlangur orlangur self-assigned this Nov 7, 2018
@orlangur
Copy link
Contributor

#18408 (comment) should be reworked.

@orlangur orlangur closed this Feb 28, 2019
@ghost
Copy link

ghost commented Feb 28, 2019

Hi @lewisvoncken, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

3 participants