Problem/Motivation

Getting an error when trying to preview a node having the publication date field and not created yet.

Steps to reproduce

Create a node having the published date field and before submitting click on node preview.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

binnythomas created an issue. See original summary.

dineshkumarbollu’s picture

StatusFileSize
new48.27 KB

Hi @binnythomas

I tested the issue in my system on preview it doesn't get any error. Am i missing anything?

Drupal: 10.1
php : 8.1

binnythomas’s picture

Try Drupal 10.2 and PHP 8.2 @dineshkumarbollu

dineshkumarbollu’s picture

StatusFileSize
new46.13 KB

Hi @binnythomas
Tested on Drupal 10.2 php 8.2, getting the error.

haryoadi’s picture

I also have this issue.

there's an extra condition on top of "previewing new node" for this issue to happen: the publication date should be included in the view display

lus’s picture

Got the same error on Drupal 9.5.11 and PHP 8.1

vensires’s picture

Issue tags: +GreeceSpringSprint2024
dineshkumarbollu’s picture

kyriazo’s picture

Assigned: Unassigned » kyriazo

kyriazo’s picture

Assigned: kyriazo » Unassigned
Status: Active » Needs review

Added a check on values massage callback function of the widget, to actually fill the value with the form submission time, if left empty.

dineshkumarbollu’s picture

StatusFileSize
new63.75 KB

MR!19 fixes the issue, LGTM

vensires’s picture

Status: Needs review » Reviewed & tested by the community
webflo’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new717 bytes

Thanks for the bug report. We decided in #3066446: Field value should be empty for entities that were never published that the field should be empty for unpublished entities. The widget should not fill the field with an computed value.

  • webflo committed 78e5aa54 on 8.x-2.x
    Issue #3424575 by kyriazo, webflo, dineshkumarbollu, binnythomas,...
webflo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wisneskit’s picture

Question to all -- Being this issue went back and forth on this thread as well as another linked thread; https://www.drupal.org/project/drupal/issues/3439347#comment-15895557, so what is the correct patch version?

Is it https://www.drupal.org/files/issues/2024-05-16/3424575-14.patch ?
Or is it https://www.drupal.org/files/issues/2024-12-11/add-revision-creation-tim... ?

Thanks.