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
- 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
- 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.

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
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
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.

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