Needs review
Project:
Publication Date
Version:
3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Mar 2023 at 16:02 UTC
Updated:
11 May 2026 at 06:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
twilderanComment #4
twilderanAdded check for field value and return empty string for unpublished nodes. Solution from 7.x branch.
Comment #5
jessey commentedComment #6
keshavv commentedI 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.
Comment #9
fagoI also ran into this or a similar issue, with autosave_form. In this case the token results in an invalid-argument-exception error!
I updated the branch, and added a kernel test to cover the cases. Note: I've used AI to help me with that.
Also attaching a patch file for usage with composer-patches.
Comment #11
shraddha kandale commentedpublication_date: 2.0.0-beta8
acquia_optimize: 2.0.0
Issue summary
While using Metatag tokens with unpublished (draft) content, I encountered an error when running Acquia Optimize Quick Scan.
Steps to reproduce
Notes
I’ve added a patch that fixes both issues by handling the unpublished node case correctly. After applying the patch, the node edit page and Quick Scan work without errors.
publication-date-token-fix.patch