I'm getting this same error on a site running Drupal 10.1.8. We can't update to a later D10 release (yet) because we have a custom module the later versions don't run on.
Uploading patch file.
pamelalies β created an issue.
Hello - just wanted to report that I solved this issue, in case anyone has the same issue and comes across this page. This is the way I finally got it to work (I was able to get past my memory issue and print out the field array on my local):
$field_key = "field_creation_ymd_date";
$date_obj = strtotime($date_day);
// Check if the converted time is good, if it's false then we'll just leave the value alone, if true then update the field.
if ($date_obj !== false) {
// Obtained a valid $timestamp; $format is valid, now put it in the fields
$form[$field_key]["widget"][0]["ymd_date"]["year"]["#value"] = date('Y',$date_obj);
$form[$field_key]["widget"][0]["ymd_date"]["month"]["#value"] = date('m',$date_obj);
$form[$field_key]["widget"][0]["ymd_date"]["day"]["#value"] = date('d',$date_obj);
}
pamelalies β created an issue.
pamelalies β created an issue.
This patch caused my site to throw: Warning: Array to string conversion in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 315 of core/lib/Drupal/Core/Entity/EntityStorageBase.php). Just posting this patch to undo it.