Missing token value for unpublished nodes

Created on 9 March 2023, over 1 year ago
Updated 9 August 2023, over 1 year ago

Problem/Motivation

I found an error with token [node:published] used in Metatag, instead of empty string we have NULL.

Steps to reproduce

1. Enable Metatags module
2. Open settings for content and set [node:published] token to article-published-time field.
3. Start creating a new unpublished node
4. After saving you get 500 error on node page for any user.

Proposed resolution

Port solution from 7.x branch - https://git.drupalcode.org/project/publication_date/-/blob/7.x-2.x/publi...

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Component

Code

Created by

🇺🇦Ukraine twilderan Kyiv, Ukraine 🇺🇦

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

Comments & Activities

  • Issue created by @twilderan
  • Assigned to twilderan
  • Status changed to Needs work over 1 year ago
  • 🇺🇦Ukraine twilderan Kyiv, Ukraine 🇺🇦
  • @twilderan opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇺🇦Ukraine twilderan Kyiv, Ukraine 🇺🇦

    Added check for field value and return empty string for unpublished nodes. Solution from 7.x branch.

  • Status changed to RTBC over 1 year ago
  • 🇮🇳India keshavv India

    I am able to reproduce the issue with the given steps.
    There is an issue and both patch and MR works well.
    The published date field is a non-required field, If you create an unpublished node, The value of the field gone null which will encounter the error.
    Adding Screenshots.

Production build 0.71.5 2024