- Issue created by @liquidcms
I have the following custom code:
// create new Paragraph
$doctype_tid = get_tid_by_name($document_type, 'document_category');
$paragraph = Paragraph::create([
'type' => 'upload_documents',
'field_upload_document' => $file_saved->id(),
'field_document_type' => $doctype_tid,
]);
$paragraph->save();
// then add new paragraph to the Policy
$policy->field_policy_documents[] = $paragraph;
$policy->save();
This has worked for years but recent upgrade from 9.5.3 to 9.5.11 and numerous contrib updates and the paragraph->save() is now silently failing (after save() paragraph has no pid). So when i do the policy save, which adds this paragraph, it fails.
Took a while to track down, but reverting recent update from ctools 8.13 to 3.15 fixes the issue.
Active
3.15
Code