I am using Magento version 2.1.3
We are getting errors while saving the category or product form the admin as:
Error: URL key for specified store already exists.
And when i searched for solution maximum suggestions are to "Truncate the url_rewrite table".
As per the suggestion i have truncated the "url_rewrite" table and tried to save the category or product from the admin. Now it shows the error as:
Error: Something went wrong while saving the category.
Please can any one suggest a best solution for this..
Can you try running the indexer from the CLI (right after you truncate the table and before trying to update values)?
Thanks for your reply..
Yes, we have tried reindexer from command line after truncating the table 'url_rewrite'.
Then we tried to save the category we are getting Errors as "Something went wrong while saving the category." instead of "URL key for specified store already exists."
And can you tell me why 'url_rewrite' table is still empty after reindexing. If it will regenerates only when we saved the category, but while saving we are getting the above error.
Please help me..
Did you delete/truncate the catalog_url_rewrite_product_category table too?
I saw that we have a FK restriction if you try to delete this information inside the database.
We have done as you suggested and we are getting the categories saved, but now a new error arises.
While Saving the products i am getting "No data to save" error and not saving anything..
Did you experience this as well..
I was looking for solution for this problem and i allready found. I created short movie with doc to fix this problem. https://www.youtube.com/watch?v=xerkbeiH2jU Step by step instruction
I think changing core files isn't the right solution. You should create a module and override the core behavior.
Maybe you can create the module and publish on GitHub or even better, is this is a bug you can create an issue https://github.com/magento/magento2/issues and explain the problem and the possible solution.