basic product repository save not work in cron - magento2Magento product stock alert cron jobCron job doesn't workCron.php/Cron.sh Not being called/Manual only - Permission problemSlow Magento 2 saving for configurable productsmagento 2 - category attribute with checkbox input throws exception on admin saveCheck if product exists before savingMagento2: CRON Job is scheduled but Not RunningHow to load custom template file for product detail page in magento2Magento 1.9 cron timeout 240 seconds1.9.2 catalog price rule - Cron not working.. Discounts disappear

How was Luke's prosthetic hand in Episode V filmed?

How much did all the space agencies spent on rockets launching and space exploration? What are the benefits for me and you?

Why is the forgetful functor representable?

Soft constraints and hard constraints

Grease/lubricate rubber stabilizer bar bushings?

How to hide your own body?

How does the Gameboy's memory bank switching work?

Satellite in orbit in front of and behind the Moon

She told me that she HAS / HAD a gun

Where can I find standards for statistical acronyms and whether they should be capitalized or lower case?

Why would word of Princess Leia's capture generate sympathy for the Rebellion in the Senate?

Rule of thumb to choose right mix of Rodinal developer?

Inside Out and Back to Front

What is the difference between uniform velocity and constant velocity?

What's a German word for »Sandbagger«?

What does a Nintendo Game Boy do when turned on without a game cartridge inserted?

What's the physical meaning of the statement that "photons don't have positions"?

Three phase systems - are there any single phase devices that are connected between two phases instead of between one phase and neutral?

Can two waves interfere head on?

Would using carbon dioxide as fuel work to reduce the greenhouse effect?

Does the Bracer of Flying Daggers really let a thief make 4 attacks per round?

Manager is asking me to eat breakfast from now on

Why didn't Balak request Bilam to bless his own people?

A bicolour masyu



basic product repository save not work in cron - magento2


Magento product stock alert cron jobCron job doesn't workCron.php/Cron.sh Not being called/Manual only - Permission problemSlow Magento 2 saving for configurable productsmagento 2 - category attribute with checkbox input throws exception on admin saveCheck if product exists before savingMagento2: CRON Job is scheduled but Not RunningHow to load custom template file for product detail page in magento2Magento 1.9 cron timeout 240 seconds1.9.2 catalog price rule - Cron not working.. Discounts disappear






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I tried the below code in custom controller and cron job method [just load and save] after that I felt some issues



$product = $this->productRepository->getById(548);
$this->productRepository->save($product);


From Controller:



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

From Cron



  • It change the product type from simple to virtual

  • product detail page goes to 404 page not found

  • It removes the product from category page.


Update



I checked the same in Magento 2.1.3



From Cron



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

is there any limitation to use product repository in cron? or did I something wrong?










share|improve this question
























  • Did anybody report a core-issue on github for this?

    – Alex
    Aug 2 '17 at 11:11

















0















I tried the below code in custom controller and cron job method [just load and save] after that I felt some issues



$product = $this->productRepository->getById(548);
$this->productRepository->save($product);


From Controller:



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

From Cron



  • It change the product type from simple to virtual

  • product detail page goes to 404 page not found

  • It removes the product from category page.


Update



I checked the same in Magento 2.1.3



From Cron



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

is there any limitation to use product repository in cron? or did I something wrong?










share|improve this question
























  • Did anybody report a core-issue on github for this?

    – Alex
    Aug 2 '17 at 11:11













0












0








0


0






I tried the below code in custom controller and cron job method [just load and save] after that I felt some issues



$product = $this->productRepository->getById(548);
$this->productRepository->save($product);


From Controller:



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

From Cron



  • It change the product type from simple to virtual

  • product detail page goes to 404 page not found

  • It removes the product from category page.


Update



I checked the same in Magento 2.1.3



From Cron



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

is there any limitation to use product repository in cron? or did I something wrong?










share|improve this question
















I tried the below code in custom controller and cron job method [just load and save] after that I felt some issues



$product = $this->productRepository->getById(548);
$this->productRepository->save($product);


From Controller:



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

From Cron



  • It change the product type from simple to virtual

  • product detail page goes to 404 page not found

  • It removes the product from category page.


Update



I checked the same in Magento 2.1.3



From Cron



  • It change the product type from simple to virtual

  • No issues in product detail page

  • It removes the product from category page.

is there any limitation to use product repository in cron? or did I something wrong?







magento2 cron sku crontab magento2.0.8






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 7 '17 at 7:51







Bilal Usean

















asked Feb 6 '17 at 10:34









Bilal UseanBilal Usean

5,4506 gold badges40 silver badges94 bronze badges




5,4506 gold badges40 silver badges94 bronze badges












  • Did anybody report a core-issue on github for this?

    – Alex
    Aug 2 '17 at 11:11

















  • Did anybody report a core-issue on github for this?

    – Alex
    Aug 2 '17 at 11:11
















Did anybody report a core-issue on github for this?

– Alex
Aug 2 '17 at 11:11





Did anybody report a core-issue on github for this?

– Alex
Aug 2 '17 at 11:11










1 Answer
1






active

oldest

votes


















0














I think you mismatch object to save a update product info. I tried blow code using corn its works for me.



 $product = $this->productRepository->getById($product_id);
$product->setName("Testing");
$product->save();


Update:



I saw vendor/magento/module-catalog/Model/ProductRepository::save() same way to save product, its works for me.



I use



 $this->productRepository->save($target, $saveOptions = false);


Instread of below line



 $this->productRepository->save($target);





share|improve this answer

























  • could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

    – Bilal Usean
    Feb 7 '17 at 8:07













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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f158332%2fbasic-product-repository-save-not-work-in-cron-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









0














I think you mismatch object to save a update product info. I tried blow code using corn its works for me.



 $product = $this->productRepository->getById($product_id);
$product->setName("Testing");
$product->save();


Update:



I saw vendor/magento/module-catalog/Model/ProductRepository::save() same way to save product, its works for me.



I use



 $this->productRepository->save($target, $saveOptions = false);


Instread of below line



 $this->productRepository->save($target);





share|improve this answer

























  • could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

    – Bilal Usean
    Feb 7 '17 at 8:07















0














I think you mismatch object to save a update product info. I tried blow code using corn its works for me.



 $product = $this->productRepository->getById($product_id);
$product->setName("Testing");
$product->save();


Update:



I saw vendor/magento/module-catalog/Model/ProductRepository::save() same way to save product, its works for me.



I use



 $this->productRepository->save($target, $saveOptions = false);


Instread of below line



 $this->productRepository->save($target);





share|improve this answer

























  • could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

    – Bilal Usean
    Feb 7 '17 at 8:07













0












0








0







I think you mismatch object to save a update product info. I tried blow code using corn its works for me.



 $product = $this->productRepository->getById($product_id);
$product->setName("Testing");
$product->save();


Update:



I saw vendor/magento/module-catalog/Model/ProductRepository::save() same way to save product, its works for me.



I use



 $this->productRepository->save($target, $saveOptions = false);


Instread of below line



 $this->productRepository->save($target);





share|improve this answer















I think you mismatch object to save a update product info. I tried blow code using corn its works for me.



 $product = $this->productRepository->getById($product_id);
$product->setName("Testing");
$product->save();


Update:



I saw vendor/magento/module-catalog/Model/ProductRepository::save() same way to save product, its works for me.



I use



 $this->productRepository->save($target, $saveOptions = false);


Instread of below line



 $this->productRepository->save($target);






share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 7 '17 at 9:55

























answered Feb 7 '17 at 7:55









Rajkumar .ERajkumar .E

1,8155 gold badges17 silver badges47 bronze badges




1,8155 gold badges17 silver badges47 bronze badges












  • could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

    – Bilal Usean
    Feb 7 '17 at 8:07

















  • could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

    – Bilal Usean
    Feb 7 '17 at 8:07
















could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

– Bilal Usean
Feb 7 '17 at 8:07





could you look at this module-catalog/Model/ProductRepository::save(), it seems like pass the product as the argument. by the way I tried you suggestion but it is not work in 2.0.8

– Bilal Usean
Feb 7 '17 at 8:07

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f158332%2fbasic-product-repository-save-not-work-in-cron-magento2%23new-answer', 'question_page');

);

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







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form