Product category update issue in magento2How to solve the error : “Could not save product ”20072“ with position 0 to category 7” in magento 2How to create and display Featured Product on Home PageError on product update via APIProduct images lost when editing a productMagento 2: How to Set Bulk Product Position in Category?INSERT ON DUPLICATE KEY UPDATE Magento2 ErrorMagento2: Could not save product “330664” with position 0 to category 3567Lost product image roles when save product by programCan't create new category and product - Integrity constraint violation: 1048 Column 'entity_id' cannot be nullProduct admin edit issue in magento 2removing categorty in product page is giving errorMagento 2.2.4: Could not save product “3395” with position 1 to category 1882
Does a component pouch automatically contain components?
The oldest tradition stopped before it got back to him
Beginner's snake game using PyGame
Can you use a concentration spell while using Mantle of Majesty?
How to properly maintain eye contact with people that have distinctive facial features?
Racetrack designers, assemble!
How do I get a list of only the files (not the directories) from a package?
Where can I find the list of all tendons in the human body?
Why does my electric oven present the option of 40A and 50A breakers?
Asking bank to reduce APR instead of increasing credit limit
How was Apollo supposed to rendezvous in the case of a lunar abort?
What if you don't bring your credit card or debit for incidentals?
Is the capacitor drawn or wired wrongly?
Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?
What does the behaviour of water on the skin of an aircraft in flight tell us?
Why is there a need to modify system call tables in Linux?
Are there mythical creatures in the world of Game of Thrones?
Pros and cons of writing a book review?
Is there any Biblical Basis for 400 years of silence between Old and New Testament?
What is the intuition behind uniform continuity?
How does increase in volume change the speed of reaction in production of NO2?
Why use water tanks from a retired Space Shuttle?
What are the problems in teaching guitar via Skype?
The deliberate use of misleading terminology
Product category update issue in magento2
How to solve the error : “Could not save product ”20072“ with position 0 to category 7” in magento 2How to create and display Featured Product on Home PageError on product update via APIProduct images lost when editing a productMagento 2: How to Set Bulk Product Position in Category?INSERT ON DUPLICATE KEY UPDATE Magento2 ErrorMagento2: Could not save product “330664” with position 0 to category 3567Lost product image roles when save product by programCan't create new category and product - Integrity constraint violation: 1048 Column 'entity_id' cannot be nullProduct admin edit issue in magento 2removing categorty in product page is giving errorMagento 2.2.4: Could not save product “3395” with position 1 to category 1882
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am updating product category from admin.. getting below error.
"Could not save product "41859" with position 0 to category 8",
Referred this link as mentioned it is fixed in 2.2.4,
How to solve the error : "Could not save product "20072" with position 0 to category 7" in magento 2
I am also using using magento version 2.2.4. but still same error is there.
Category is not updating even if we update from admin side.
Is any fix available for this? Please anybody help me. Thanks
magento2 product category
|
show 5 more comments
I am updating product category from admin.. getting below error.
"Could not save product "41859" with position 0 to category 8",
Referred this link as mentioned it is fixed in 2.2.4,
How to solve the error : "Could not save product "20072" with position 0 to category 7" in magento 2
I am also using using magento version 2.2.4. but still same error is there.
Category is not updating even if we update from admin side.
Is any fix available for this? Please anybody help me. Thanks
magento2 product category
You can check this link Cannot assign products to categories Thanks, pritam
– Pritam Info 24
Nov 26 '18 at 7:04
Seems it has magento 2 bug.
– Amit Bera♦
Nov 26 '18 at 11:04
@AmitBera, So any fix available for this?
– jafar pinjar
Nov 26 '18 at 11:08
I do not have any fixing right now. I will check and get back to you
– Amit Bera♦
Nov 26 '18 at 11:24
@AmitBera, Sure, Please check it and update me, this issue is blocked all other testing of our site. Thanks
– jafar pinjar
Nov 26 '18 at 11:29
|
show 5 more comments
I am updating product category from admin.. getting below error.
"Could not save product "41859" with position 0 to category 8",
Referred this link as mentioned it is fixed in 2.2.4,
How to solve the error : "Could not save product "20072" with position 0 to category 7" in magento 2
I am also using using magento version 2.2.4. but still same error is there.
Category is not updating even if we update from admin side.
Is any fix available for this? Please anybody help me. Thanks
magento2 product category
I am updating product category from admin.. getting below error.
"Could not save product "41859" with position 0 to category 8",
Referred this link as mentioned it is fixed in 2.2.4,
How to solve the error : "Could not save product "20072" with position 0 to category 7" in magento 2
I am also using using magento version 2.2.4. but still same error is there.
Category is not updating even if we update from admin side.
Is any fix available for this? Please anybody help me. Thanks
magento2 product category
magento2 product category
edited Nov 26 '18 at 6:23
jafar pinjar
asked Nov 24 '18 at 12:08
jafar pinjarjafar pinjar
950418
950418
You can check this link Cannot assign products to categories Thanks, pritam
– Pritam Info 24
Nov 26 '18 at 7:04
Seems it has magento 2 bug.
– Amit Bera♦
Nov 26 '18 at 11:04
@AmitBera, So any fix available for this?
– jafar pinjar
Nov 26 '18 at 11:08
I do not have any fixing right now. I will check and get back to you
– Amit Bera♦
Nov 26 '18 at 11:24
@AmitBera, Sure, Please check it and update me, this issue is blocked all other testing of our site. Thanks
– jafar pinjar
Nov 26 '18 at 11:29
|
show 5 more comments
You can check this link Cannot assign products to categories Thanks, pritam
– Pritam Info 24
Nov 26 '18 at 7:04
Seems it has magento 2 bug.
– Amit Bera♦
Nov 26 '18 at 11:04
@AmitBera, So any fix available for this?
– jafar pinjar
Nov 26 '18 at 11:08
I do not have any fixing right now. I will check and get back to you
– Amit Bera♦
Nov 26 '18 at 11:24
@AmitBera, Sure, Please check it and update me, this issue is blocked all other testing of our site. Thanks
– jafar pinjar
Nov 26 '18 at 11:29
You can check this link Cannot assign products to categories Thanks, pritam
– Pritam Info 24
Nov 26 '18 at 7:04
You can check this link Cannot assign products to categories Thanks, pritam
– Pritam Info 24
Nov 26 '18 at 7:04
Seems it has magento 2 bug.
– Amit Bera♦
Nov 26 '18 at 11:04
Seems it has magento 2 bug.
– Amit Bera♦
Nov 26 '18 at 11:04
@AmitBera, So any fix available for this?
– jafar pinjar
Nov 26 '18 at 11:08
@AmitBera, So any fix available for this?
– jafar pinjar
Nov 26 '18 at 11:08
I do not have any fixing right now. I will check and get back to you
– Amit Bera♦
Nov 26 '18 at 11:24
I do not have any fixing right now. I will check and get back to you
– Amit Bera♦
Nov 26 '18 at 11:24
@AmitBera, Sure, Please check it and update me, this issue is blocked all other testing of our site. Thanks
– jafar pinjar
Nov 26 '18 at 11:29
@AmitBera, Sure, Please check it and update me, this issue is blocked all other testing of our site. Thanks
– jafar pinjar
Nov 26 '18 at 11:29
|
show 5 more comments
1 Answer
1
active
oldest
votes
I have faced same issue and fixed to update file MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver.php
and MagentoCatalogUrlRewriteObserverUrlRewriteHandler.php
and working fine.
I have override with custom module and updated fixed code.
File path: magento/app/code/Vendor/CategorySave/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_CategorySave',
__DIR__
);
File path: magento/app/code/Vendor/CategorySave/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_CategorySave" setup_version="1.0.0">
</module>
</config>
File path: magento/app/code/Vendor/CategorySave/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver" type="VendorCategorySaveObserverCategoryProcessUrlRewriteSavingObserver" />
<preference for="MagentoCatalogUrlRewriteObserverUrlRewriteHandler" type="VendorCategorySaveObserverUrlRewriteHandler" />
</config>
File path:
magento/app/code/Vendor/CategorySave/Observer/CategoryProcessUrlRewriteSavingObserver.php
<?php
namespace VendorCategorySaveObserver;
use MagentoCatalogModelCategory;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelMapDatabaseMapPool;
use MagentoCatalogUrlRewriteModelMapDataCategoryUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelMapDataProductUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer;
use MagentoFrameworkEventObserverInterface;
use MagentoStoreModelResourceModelGroupCollectionFactory;
use MagentoStoreModelResourceModelGroupCollection as StoreGroupCollection;
use MagentoFrameworkAppObjectManager;
/**
* Generates Category Url Rewrites after save and Products Url Rewrites assigned to the category that's being saved
*/
class CategoryProcessUrlRewriteSavingObserver extends MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver
/**
* @var MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator
*/
private $categoryUrlRewriteGenerator;
/**
* @var MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer
*/
private $urlRewriteBunchReplacer;
/**
* @var MagentoCatalogUrlRewriteObserverUrlRewriteHandler
*/
private $urlRewriteHandler;
/**
* @var MagentoCatalogUrlRewriteModelMapDatabaseMapPool
*/
private $databaseMapPool;
/**
* @var string[]
*/
private $dataUrlRewriteClassNames;
/**
* @var CollectionFactory
*/
private $storeGroupFactory;
/**
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param UrlRewriteHandler $urlRewriteHandler
* @param UrlRewriteBunchReplacer $urlRewriteBunchReplacer
* @param DatabaseMapPool $databaseMapPool
* @param string[] $dataUrlRewriteClassNames
* @param CollectionFactory
File path:
magento/app/code/Vendor/CategorySave/Observer/UrlRewriteHandler.php
<?php
declare(strict_types=1);
namespace VendorCategorySaveObserver;
use MagentoCatalogModelProduct;
use MagentoCatalogModelCategory;
use MagentoCatalogModelResourceModelProductCollection;
use MagentoCatalogModelResourceModelProductCollectionFactory;
use MagentoCatalogUrlRewriteModelCategoryChildrenCategoriesProvider;
use MagentoCatalogUrlRewriteModelCategoryProductUrlPathGenerator;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductScopeRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductUrlRewriteGenerator;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkSerializeSerializerJson;
use MagentoUrlRewriteModelMergeDataProvider;
use MagentoUrlRewriteModelMergeDataProviderFactory;
use MagentoUrlRewriteModelUrlPersistInterface;
use MagentoUrlRewriteServiceV1DataUrlRewrite;
/**
* Class for management url rewrites.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UrlRewriteHandler extends MagentoCatalogUrlRewriteObserverUrlRewriteHandler
/**
* @var ChildrenCategoriesProvider
*/
protected $childrenCategoriesProvider;
/**
* @var CategoryUrlRewriteGenerator
*/
protected $categoryUrlRewriteGenerator;
/**
* @var ProductUrlRewriteGenerator
*/
protected $productUrlRewriteGenerator;
/**
* @var UrlPersistInterface
*/
protected $urlPersist;
/**
* @var array
*/
protected $isSkippedProduct;
/**
* @var CollectionFactory
*/
protected $productCollectionFactory;
/**
* @var CategoryProductUrlPathGenerator
*/
private $categoryBasedProductRewriteGenerator;
/**
* @var MergeDataProvider
*/
private $mergeDataProviderPrototype;
/**
* @var Json
*/
private $serializer;
/**
* @var ProductScopeRewriteGenerator
*/
private $productScopeRewriteGenerator;
/**
* @param ChildrenCategoriesProvider $childrenCategoriesProvider
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param ProductUrlRewriteGenerator $productUrlRewriteGenerator
* @param UrlPersistInterface $urlPersist
* @param CollectionFactory $productCollectionFactory
* @param CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator
* @param MergeDataProviderFactory
Hope it help!
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251183%2fproduct-category-update-issue-in-magento2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have faced same issue and fixed to update file MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver.php
and MagentoCatalogUrlRewriteObserverUrlRewriteHandler.php
and working fine.
I have override with custom module and updated fixed code.
File path: magento/app/code/Vendor/CategorySave/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_CategorySave',
__DIR__
);
File path: magento/app/code/Vendor/CategorySave/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_CategorySave" setup_version="1.0.0">
</module>
</config>
File path: magento/app/code/Vendor/CategorySave/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver" type="VendorCategorySaveObserverCategoryProcessUrlRewriteSavingObserver" />
<preference for="MagentoCatalogUrlRewriteObserverUrlRewriteHandler" type="VendorCategorySaveObserverUrlRewriteHandler" />
</config>
File path:
magento/app/code/Vendor/CategorySave/Observer/CategoryProcessUrlRewriteSavingObserver.php
<?php
namespace VendorCategorySaveObserver;
use MagentoCatalogModelCategory;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelMapDatabaseMapPool;
use MagentoCatalogUrlRewriteModelMapDataCategoryUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelMapDataProductUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer;
use MagentoFrameworkEventObserverInterface;
use MagentoStoreModelResourceModelGroupCollectionFactory;
use MagentoStoreModelResourceModelGroupCollection as StoreGroupCollection;
use MagentoFrameworkAppObjectManager;
/**
* Generates Category Url Rewrites after save and Products Url Rewrites assigned to the category that's being saved
*/
class CategoryProcessUrlRewriteSavingObserver extends MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver
/**
* @var MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator
*/
private $categoryUrlRewriteGenerator;
/**
* @var MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer
*/
private $urlRewriteBunchReplacer;
/**
* @var MagentoCatalogUrlRewriteObserverUrlRewriteHandler
*/
private $urlRewriteHandler;
/**
* @var MagentoCatalogUrlRewriteModelMapDatabaseMapPool
*/
private $databaseMapPool;
/**
* @var string[]
*/
private $dataUrlRewriteClassNames;
/**
* @var CollectionFactory
*/
private $storeGroupFactory;
/**
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param UrlRewriteHandler $urlRewriteHandler
* @param UrlRewriteBunchReplacer $urlRewriteBunchReplacer
* @param DatabaseMapPool $databaseMapPool
* @param string[] $dataUrlRewriteClassNames
* @param CollectionFactory
File path:
magento/app/code/Vendor/CategorySave/Observer/UrlRewriteHandler.php
<?php
declare(strict_types=1);
namespace VendorCategorySaveObserver;
use MagentoCatalogModelProduct;
use MagentoCatalogModelCategory;
use MagentoCatalogModelResourceModelProductCollection;
use MagentoCatalogModelResourceModelProductCollectionFactory;
use MagentoCatalogUrlRewriteModelCategoryChildrenCategoriesProvider;
use MagentoCatalogUrlRewriteModelCategoryProductUrlPathGenerator;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductScopeRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductUrlRewriteGenerator;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkSerializeSerializerJson;
use MagentoUrlRewriteModelMergeDataProvider;
use MagentoUrlRewriteModelMergeDataProviderFactory;
use MagentoUrlRewriteModelUrlPersistInterface;
use MagentoUrlRewriteServiceV1DataUrlRewrite;
/**
* Class for management url rewrites.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UrlRewriteHandler extends MagentoCatalogUrlRewriteObserverUrlRewriteHandler
/**
* @var ChildrenCategoriesProvider
*/
protected $childrenCategoriesProvider;
/**
* @var CategoryUrlRewriteGenerator
*/
protected $categoryUrlRewriteGenerator;
/**
* @var ProductUrlRewriteGenerator
*/
protected $productUrlRewriteGenerator;
/**
* @var UrlPersistInterface
*/
protected $urlPersist;
/**
* @var array
*/
protected $isSkippedProduct;
/**
* @var CollectionFactory
*/
protected $productCollectionFactory;
/**
* @var CategoryProductUrlPathGenerator
*/
private $categoryBasedProductRewriteGenerator;
/**
* @var MergeDataProvider
*/
private $mergeDataProviderPrototype;
/**
* @var Json
*/
private $serializer;
/**
* @var ProductScopeRewriteGenerator
*/
private $productScopeRewriteGenerator;
/**
* @param ChildrenCategoriesProvider $childrenCategoriesProvider
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param ProductUrlRewriteGenerator $productUrlRewriteGenerator
* @param UrlPersistInterface $urlPersist
* @param CollectionFactory $productCollectionFactory
* @param CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator
* @param MergeDataProviderFactory
Hope it help!
add a comment |
I have faced same issue and fixed to update file MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver.php
and MagentoCatalogUrlRewriteObserverUrlRewriteHandler.php
and working fine.
I have override with custom module and updated fixed code.
File path: magento/app/code/Vendor/CategorySave/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_CategorySave',
__DIR__
);
File path: magento/app/code/Vendor/CategorySave/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_CategorySave" setup_version="1.0.0">
</module>
</config>
File path: magento/app/code/Vendor/CategorySave/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver" type="VendorCategorySaveObserverCategoryProcessUrlRewriteSavingObserver" />
<preference for="MagentoCatalogUrlRewriteObserverUrlRewriteHandler" type="VendorCategorySaveObserverUrlRewriteHandler" />
</config>
File path:
magento/app/code/Vendor/CategorySave/Observer/CategoryProcessUrlRewriteSavingObserver.php
<?php
namespace VendorCategorySaveObserver;
use MagentoCatalogModelCategory;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelMapDatabaseMapPool;
use MagentoCatalogUrlRewriteModelMapDataCategoryUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelMapDataProductUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer;
use MagentoFrameworkEventObserverInterface;
use MagentoStoreModelResourceModelGroupCollectionFactory;
use MagentoStoreModelResourceModelGroupCollection as StoreGroupCollection;
use MagentoFrameworkAppObjectManager;
/**
* Generates Category Url Rewrites after save and Products Url Rewrites assigned to the category that's being saved
*/
class CategoryProcessUrlRewriteSavingObserver extends MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver
/**
* @var MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator
*/
private $categoryUrlRewriteGenerator;
/**
* @var MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer
*/
private $urlRewriteBunchReplacer;
/**
* @var MagentoCatalogUrlRewriteObserverUrlRewriteHandler
*/
private $urlRewriteHandler;
/**
* @var MagentoCatalogUrlRewriteModelMapDatabaseMapPool
*/
private $databaseMapPool;
/**
* @var string[]
*/
private $dataUrlRewriteClassNames;
/**
* @var CollectionFactory
*/
private $storeGroupFactory;
/**
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param UrlRewriteHandler $urlRewriteHandler
* @param UrlRewriteBunchReplacer $urlRewriteBunchReplacer
* @param DatabaseMapPool $databaseMapPool
* @param string[] $dataUrlRewriteClassNames
* @param CollectionFactory
File path:
magento/app/code/Vendor/CategorySave/Observer/UrlRewriteHandler.php
<?php
declare(strict_types=1);
namespace VendorCategorySaveObserver;
use MagentoCatalogModelProduct;
use MagentoCatalogModelCategory;
use MagentoCatalogModelResourceModelProductCollection;
use MagentoCatalogModelResourceModelProductCollectionFactory;
use MagentoCatalogUrlRewriteModelCategoryChildrenCategoriesProvider;
use MagentoCatalogUrlRewriteModelCategoryProductUrlPathGenerator;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductScopeRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductUrlRewriteGenerator;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkSerializeSerializerJson;
use MagentoUrlRewriteModelMergeDataProvider;
use MagentoUrlRewriteModelMergeDataProviderFactory;
use MagentoUrlRewriteModelUrlPersistInterface;
use MagentoUrlRewriteServiceV1DataUrlRewrite;
/**
* Class for management url rewrites.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UrlRewriteHandler extends MagentoCatalogUrlRewriteObserverUrlRewriteHandler
/**
* @var ChildrenCategoriesProvider
*/
protected $childrenCategoriesProvider;
/**
* @var CategoryUrlRewriteGenerator
*/
protected $categoryUrlRewriteGenerator;
/**
* @var ProductUrlRewriteGenerator
*/
protected $productUrlRewriteGenerator;
/**
* @var UrlPersistInterface
*/
protected $urlPersist;
/**
* @var array
*/
protected $isSkippedProduct;
/**
* @var CollectionFactory
*/
protected $productCollectionFactory;
/**
* @var CategoryProductUrlPathGenerator
*/
private $categoryBasedProductRewriteGenerator;
/**
* @var MergeDataProvider
*/
private $mergeDataProviderPrototype;
/**
* @var Json
*/
private $serializer;
/**
* @var ProductScopeRewriteGenerator
*/
private $productScopeRewriteGenerator;
/**
* @param ChildrenCategoriesProvider $childrenCategoriesProvider
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param ProductUrlRewriteGenerator $productUrlRewriteGenerator
* @param UrlPersistInterface $urlPersist
* @param CollectionFactory $productCollectionFactory
* @param CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator
* @param MergeDataProviderFactory
Hope it help!
add a comment |
I have faced same issue and fixed to update file MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver.php
and MagentoCatalogUrlRewriteObserverUrlRewriteHandler.php
and working fine.
I have override with custom module and updated fixed code.
File path: magento/app/code/Vendor/CategorySave/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_CategorySave',
__DIR__
);
File path: magento/app/code/Vendor/CategorySave/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_CategorySave" setup_version="1.0.0">
</module>
</config>
File path: magento/app/code/Vendor/CategorySave/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver" type="VendorCategorySaveObserverCategoryProcessUrlRewriteSavingObserver" />
<preference for="MagentoCatalogUrlRewriteObserverUrlRewriteHandler" type="VendorCategorySaveObserverUrlRewriteHandler" />
</config>
File path:
magento/app/code/Vendor/CategorySave/Observer/CategoryProcessUrlRewriteSavingObserver.php
<?php
namespace VendorCategorySaveObserver;
use MagentoCatalogModelCategory;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelMapDatabaseMapPool;
use MagentoCatalogUrlRewriteModelMapDataCategoryUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelMapDataProductUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer;
use MagentoFrameworkEventObserverInterface;
use MagentoStoreModelResourceModelGroupCollectionFactory;
use MagentoStoreModelResourceModelGroupCollection as StoreGroupCollection;
use MagentoFrameworkAppObjectManager;
/**
* Generates Category Url Rewrites after save and Products Url Rewrites assigned to the category that's being saved
*/
class CategoryProcessUrlRewriteSavingObserver extends MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver
/**
* @var MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator
*/
private $categoryUrlRewriteGenerator;
/**
* @var MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer
*/
private $urlRewriteBunchReplacer;
/**
* @var MagentoCatalogUrlRewriteObserverUrlRewriteHandler
*/
private $urlRewriteHandler;
/**
* @var MagentoCatalogUrlRewriteModelMapDatabaseMapPool
*/
private $databaseMapPool;
/**
* @var string[]
*/
private $dataUrlRewriteClassNames;
/**
* @var CollectionFactory
*/
private $storeGroupFactory;
/**
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param UrlRewriteHandler $urlRewriteHandler
* @param UrlRewriteBunchReplacer $urlRewriteBunchReplacer
* @param DatabaseMapPool $databaseMapPool
* @param string[] $dataUrlRewriteClassNames
* @param CollectionFactory
File path:
magento/app/code/Vendor/CategorySave/Observer/UrlRewriteHandler.php
<?php
declare(strict_types=1);
namespace VendorCategorySaveObserver;
use MagentoCatalogModelProduct;
use MagentoCatalogModelCategory;
use MagentoCatalogModelResourceModelProductCollection;
use MagentoCatalogModelResourceModelProductCollectionFactory;
use MagentoCatalogUrlRewriteModelCategoryChildrenCategoriesProvider;
use MagentoCatalogUrlRewriteModelCategoryProductUrlPathGenerator;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductScopeRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductUrlRewriteGenerator;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkSerializeSerializerJson;
use MagentoUrlRewriteModelMergeDataProvider;
use MagentoUrlRewriteModelMergeDataProviderFactory;
use MagentoUrlRewriteModelUrlPersistInterface;
use MagentoUrlRewriteServiceV1DataUrlRewrite;
/**
* Class for management url rewrites.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UrlRewriteHandler extends MagentoCatalogUrlRewriteObserverUrlRewriteHandler
/**
* @var ChildrenCategoriesProvider
*/
protected $childrenCategoriesProvider;
/**
* @var CategoryUrlRewriteGenerator
*/
protected $categoryUrlRewriteGenerator;
/**
* @var ProductUrlRewriteGenerator
*/
protected $productUrlRewriteGenerator;
/**
* @var UrlPersistInterface
*/
protected $urlPersist;
/**
* @var array
*/
protected $isSkippedProduct;
/**
* @var CollectionFactory
*/
protected $productCollectionFactory;
/**
* @var CategoryProductUrlPathGenerator
*/
private $categoryBasedProductRewriteGenerator;
/**
* @var MergeDataProvider
*/
private $mergeDataProviderPrototype;
/**
* @var Json
*/
private $serializer;
/**
* @var ProductScopeRewriteGenerator
*/
private $productScopeRewriteGenerator;
/**
* @param ChildrenCategoriesProvider $childrenCategoriesProvider
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param ProductUrlRewriteGenerator $productUrlRewriteGenerator
* @param UrlPersistInterface $urlPersist
* @param CollectionFactory $productCollectionFactory
* @param CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator
* @param MergeDataProviderFactory
Hope it help!
I have faced same issue and fixed to update file MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver.php
and MagentoCatalogUrlRewriteObserverUrlRewriteHandler.php
and working fine.
I have override with custom module and updated fixed code.
File path: magento/app/code/Vendor/CategorySave/registration.php
<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_CategorySave',
__DIR__
);
File path: magento/app/code/Vendor/CategorySave/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_CategorySave" setup_version="1.0.0">
</module>
</config>
File path: magento/app/code/Vendor/CategorySave/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver" type="VendorCategorySaveObserverCategoryProcessUrlRewriteSavingObserver" />
<preference for="MagentoCatalogUrlRewriteObserverUrlRewriteHandler" type="VendorCategorySaveObserverUrlRewriteHandler" />
</config>
File path:
magento/app/code/Vendor/CategorySave/Observer/CategoryProcessUrlRewriteSavingObserver.php
<?php
namespace VendorCategorySaveObserver;
use MagentoCatalogModelCategory;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelMapDatabaseMapPool;
use MagentoCatalogUrlRewriteModelMapDataCategoryUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelMapDataProductUrlRewriteDatabaseMap;
use MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer;
use MagentoFrameworkEventObserverInterface;
use MagentoStoreModelResourceModelGroupCollectionFactory;
use MagentoStoreModelResourceModelGroupCollection as StoreGroupCollection;
use MagentoFrameworkAppObjectManager;
/**
* Generates Category Url Rewrites after save and Products Url Rewrites assigned to the category that's being saved
*/
class CategoryProcessUrlRewriteSavingObserver extends MagentoCatalogUrlRewriteObserverCategoryProcessUrlRewriteSavingObserver
/**
* @var MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator
*/
private $categoryUrlRewriteGenerator;
/**
* @var MagentoCatalogUrlRewriteModelUrlRewriteBunchReplacer
*/
private $urlRewriteBunchReplacer;
/**
* @var MagentoCatalogUrlRewriteObserverUrlRewriteHandler
*/
private $urlRewriteHandler;
/**
* @var MagentoCatalogUrlRewriteModelMapDatabaseMapPool
*/
private $databaseMapPool;
/**
* @var string[]
*/
private $dataUrlRewriteClassNames;
/**
* @var CollectionFactory
*/
private $storeGroupFactory;
/**
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param UrlRewriteHandler $urlRewriteHandler
* @param UrlRewriteBunchReplacer $urlRewriteBunchReplacer
* @param DatabaseMapPool $databaseMapPool
* @param string[] $dataUrlRewriteClassNames
* @param CollectionFactory
File path:
magento/app/code/Vendor/CategorySave/Observer/UrlRewriteHandler.php
<?php
declare(strict_types=1);
namespace VendorCategorySaveObserver;
use MagentoCatalogModelProduct;
use MagentoCatalogModelCategory;
use MagentoCatalogModelResourceModelProductCollection;
use MagentoCatalogModelResourceModelProductCollectionFactory;
use MagentoCatalogUrlRewriteModelCategoryChildrenCategoriesProvider;
use MagentoCatalogUrlRewriteModelCategoryProductUrlPathGenerator;
use MagentoCatalogUrlRewriteModelCategoryUrlRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductScopeRewriteGenerator;
use MagentoCatalogUrlRewriteModelProductUrlRewriteGenerator;
use MagentoFrameworkAppObjectManager;
use MagentoFrameworkSerializeSerializerJson;
use MagentoUrlRewriteModelMergeDataProvider;
use MagentoUrlRewriteModelMergeDataProviderFactory;
use MagentoUrlRewriteModelUrlPersistInterface;
use MagentoUrlRewriteServiceV1DataUrlRewrite;
/**
* Class for management url rewrites.
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class UrlRewriteHandler extends MagentoCatalogUrlRewriteObserverUrlRewriteHandler
/**
* @var ChildrenCategoriesProvider
*/
protected $childrenCategoriesProvider;
/**
* @var CategoryUrlRewriteGenerator
*/
protected $categoryUrlRewriteGenerator;
/**
* @var ProductUrlRewriteGenerator
*/
protected $productUrlRewriteGenerator;
/**
* @var UrlPersistInterface
*/
protected $urlPersist;
/**
* @var array
*/
protected $isSkippedProduct;
/**
* @var CollectionFactory
*/
protected $productCollectionFactory;
/**
* @var CategoryProductUrlPathGenerator
*/
private $categoryBasedProductRewriteGenerator;
/**
* @var MergeDataProvider
*/
private $mergeDataProviderPrototype;
/**
* @var Json
*/
private $serializer;
/**
* @var ProductScopeRewriteGenerator
*/
private $productScopeRewriteGenerator;
/**
* @param ChildrenCategoriesProvider $childrenCategoriesProvider
* @param CategoryUrlRewriteGenerator $categoryUrlRewriteGenerator
* @param ProductUrlRewriteGenerator $productUrlRewriteGenerator
* @param UrlPersistInterface $urlPersist
* @param CollectionFactory $productCollectionFactory
* @param CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator
* @param MergeDataProviderFactory
Hope it help!
answered May 24 at 6:18
Kirti NariyaKirti Nariya
1,420517
1,420517
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251183%2fproduct-category-update-issue-in-magento2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can check this link Cannot assign products to categories Thanks, pritam
– Pritam Info 24
Nov 26 '18 at 7:04
Seems it has magento 2 bug.
– Amit Bera♦
Nov 26 '18 at 11:04
@AmitBera, So any fix available for this?
– jafar pinjar
Nov 26 '18 at 11:08
I do not have any fixing right now. I will check and get back to you
– Amit Bera♦
Nov 26 '18 at 11:24
@AmitBera, Sure, Please check it and update me, this issue is blocked all other testing of our site. Thanks
– jafar pinjar
Nov 26 '18 at 11:29