is there any case, where the page update removes all field informations?
e.g. i am using it to update a price
foreach($products as $product){
// calculate $newprice
$product->update([
'price' => number_format($newprice,2);
],'de'); // DE is default and only lang
}
and sometimes, this will delete all content/field of said page e.g. title changes into uid, all other fields are emtpy, including images/files-fields. (files are untouched)
in this example loop, after days, or weeks, maybe one out of 20 pages are being reset.
looking at error logs, it seems there is no error.
- what if the calculation results in “null”, or the calculation throws an unexpected error?
- is there any scenario where it would remove all fields?
- what if the page would have a “lock” file and the update will happen?
- what if the page update runs twice within a second? (more like, the script is not finished with processing the loop but another loop is being started)
trying to pinpoint the problem, is there any other way to make sure it’s only possible to update the one field without being being possible to touch the rest?