New nodes created via complex form incorrectly display as published.

Created on 20 September 2023, about 1 year ago
Updated 21 September 2023, about 1 year ago

Problem/Motivation

When adding a new node via the complex form, it displays as published in the table status column. Saving the parent node will show the same node as 'unpublished' when the page reloads.

Steps to reproduce

Edit an existing parent node and scroll to the IEF complex form and click 'Create New'.
Add any test data to the form fields
Save the IEF.
The table showing the entity references incorrectly shows the new node as published.

Proposed resolution

I'm happy to work on a patch if I can get guidance on where to look.
I did find the following and I'm assuming that new nodes are marked as 'format_custom_true' by mistake as they are not yet saved (and have no nid etc).

$fields['status'] = [
      'type' => 'field',
      'label' => $this->t('Status'),
      'weight' => 100,
      'display_options' => [
        'settings' => [
          'format' => 'custom',
          'format_custom_false' => $this->t('Unpublished'),
          'format_custom_true' => $this->t('Published'),
        ],
      ],
    ];

I can see the elements being created and I'm wondering if the entity itself is being used for these values rather than setting a row value explicitly.

Thanks in advance and happy to look into it further with some help.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia cb Sydney

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

Comments & Activities

Production build 0.71.5 2024