Skip to content

[5.x]: Backend - meta fields postDate and expiryDate not visible for entries without section. #17638

@Megafry

Description

@Megafry

What happened?

Description

Multiple customers have asked us why the post and expiry dates cannot be set for entries inside matrix fields.
After looking at the code I found that this has been disabled.
Is there a reason why this is the case? Can this be changed?

Steps to reproduce

  1. Open an entry in a new tab from a matrix field via the menu option Open in a new tab or go to admin/edit/45
  2. In the sidebar, the post and expiry date fields are not visible.

Expected behavior

The fields should be visible.
In Craft CMS, all entries have a status, a start date, and an end date, therefore, the editor should have the option to set them.

Move this block of code out of the condition:
Code

If enabled, everything works as expected, my entry gets hidden in the frontend after expiration.
Image

Actual behavior

The fields are not visible because of this condition:
code
if ($section && $section->type !== Section::TYPE_SINGLE) {}

Craft CMS version

5.7.4

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions