magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Can not change product attributes in Console\Command

Open bkristl opened this issue 10 years ago • 4 comments

If Google Analytics is enabled and Enable Content Experiments is enabled in web administration (menu - stores->configuration->sales->Google API->Google Analytics), then you can not change products attributes values in Console\Command.

WHY ?

Because Google Analytics observer (Magento\GoogleOptimizer\Observer\Product\SaveGoogleExperimentScriptObserver) is run when an event catalog_product_save_after is triggered.

Magento\GoogleOptimizer\Observer\Product\SaveGoogleExperimentScriptObserver extends \Magento\GoogleOptimizer\Observer\AbstractSave in which is defined initialization request params function _initRequestParams.

But when you use Console\Command there is no HTTP request !!!! So this observer must not run when is used CLI environment.

bkristl avatar Apr 18 '16 15:04 bkristl

@bkristl thank you for reporting, we have created MAGETWO-52045 to investigate and fix.

mazhalai avatar Apr 19 '16 13:04 mazhalai

@bkristl please specify the version where you can reproduce the problem, because the function isDataAvailable is to prevent the run of _initRequestParams. You have created a custom console command?

duhon avatar May 17 '16 20:05 duhon

@bkristl we need your response to the question above to proceed with the fix.

piotrekkaminski avatar May 24 '16 05:05 piotrekkaminski

@bkristl closing due by non-responsiveness.

duhon avatar Jun 03 '16 10:06 duhon