Publish on field changes to required state when revision is set for content type

Created on 7 February 2024, 11 months ago
Updated 8 February 2024, 10 months ago

Problem/Motivation

"Publish on" field changes to required state and throws the error " when revision is ON for a content type

Steps to reproduce

Edit any content type and in "Scheduler" tab select "Enable scheduled publishing for basic page content items'
In Publishing options tab select "Create new revision" only
Create a basic page content and publish it with empty publish date.
Edit again and click on "Preview"
Click on "Back to Content editing" and on this Edit page you will see the error as 'This value should not be null.' as the field "Publish on" is changed to required.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India bala_28 Chennai

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

Comments & Activities

  • Issue created by @bala_28
  • 🇮🇳India bala_28 Chennai

    Found that this error occurs due to the overridden massageFormValues() in /src/Plugin/Field/FieldWidget/TimestampDatetimeNoDefaultWidget.php

    After removing this method, the error is not reproducible.

    Created the patch accordingly. Please review.

  • 🇬🇧United Kingdom jonathan1055

    Hi bala_28,
    Just pointing out some things here, on how to post issues and how to get support from the maintainer

    1. If you want a patch to get tested, please run the tests
    2. If you want a patch reviewed then set the status to 'needs review'
    3. Just saying "created patch" and demanding "please review" is not likely to make me or other maintainers look kindly towards helping you
    4. However, I have looked at the patch and it simply deletes a method from the code. Do you really think that this is a solution that would be accepted?
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    30:53
    29:41
    Running
  • 🇮🇳India bala_28 Chennai

    Patch #3 is invalid and it updates the current time on submit.

Production build 0.71.5 2024