visit the entry in the control panel and press Save.
The initial state of the entry in the control panel—before any content migration or re-save—differs.
Craft 3:
Craft 4:
Notice how the status is “Enabled” and “Live” in Craft 3 and “Enabled” + “Enabled” in Craft 4. The latter immediately changes to “Live” after you press Save.
Steps to reproduce
Check out https://github.com/craftcms/starter-blog at its main branch, establish an environment for it, and run php craft install. (Project config should automatically be applied.)
Description
Immediately after installing Craft and applying project config, query behavior for Singles differs between Craft 3 and Craft 4.
This element query returns the homepage entry as expected in Craft 3, but returns
null
in Craft 4:To have the entry returned in Craft 4, you can either...
->status(null)
;Entry::find()->slug('home')->status(null)->one()
orThe initial state of the entry in the control panel—before any content migration or re-save—differs.
Craft 3:
Craft 4:
Notice how the status is “Enabled” and “Live” in Craft 3 and “Enabled” + “Enabled” in Craft 4. The latter immediately changes to “Live” after you press Save.
Steps to reproduce
php craft install
. (Project config should automatically be applied.)->status(null)
here.php craft up
and notice the content migration fails with the message “Home is missing.”.Expected behavior
Homepage element query and migration should work identically in Craft 3 and Craft 4 since we’ve got an enabled and presumably live single.
Actual behavior
Element query requires
->status(null)
in Craft 4, and the entry itself changes status on save with no edits.Craft CMS version
4.0.0-beta.4
PHP version
8.0.15
Operating system and version
macOS 12.3.1
Database type and version
MySQL 8.0.26
Image driver and version
Imagick 3.6.0 (ImageMagick 6.9.11-60)
Installed plugins and versions