Can't save paragraphs with upgrade from 3.13 to 3.15.

Created on 1 January 2025, 3 months ago

Problem/Motivation

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.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.15

Component

Code

Created by

🇨🇦Canada liquidcms

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024