Skip to content

updating product description via coding correctly shows text on product page but admin side’s edit description with pagebuilder shows old values?

In my custom module, I am able to set the description of an existing product successfully using the code below & the product url shows correct output for description:

$product = $this->productRepository->get('q783');
$product->setData('description','hello world');
$this->productRepository->save($product);

However, this programmatically saved description doesn’t show up on the admin side rather the edit with page builder form for description shows old values. When you try to update the description using page builder from the browser after having updated it once via php code, the browser edited form does in fact show newer values on the admin side but there is no change on the product url’s description despite multiple cache refreshes and reindexing.

Is this expected behavior? Do I need to store description using php code in a different manner so that the saved shows up in edit with page builder section for description on the admin side?

As it stands now, both php code set and manually filled description using edit with page builder are out of sync albeit the actual product url is continuously showing php code set descriptions, no matter how many times I update the product form via browser with newer description values in page builder.