A collection of articles on what you need to do to prepare for Craft CMS 4.
Craft CMS version 4 is due out in beta in Q1 2022 and then a final release sometime in Q2. There will be plenty of time to get ready but you shouldn’t put it off until the last minute.
Here is some helpful information on Craft CMS4 and how you can prepare:
Pixel & Tonic announced Craft 4 features during Dot All 2021. Planned right now are support for collections, multi-factor auth, inactive user accounts, conditional fields, and more.
In the State of Craft talk at the 2021 Dot All conference, Pixel & Tonic CEO Brandon Kelly announced that Craft 4 will be available in beta starting in the first quarter of 2022, with a final release the quarter after.
Back in 2018, when Craft 3.0 was released, the Craft CMS officially deprecated some Craft 2 and prior configuration settings, PHP constants, template tags, template functions, query parameters, query methods, element properties, model methods, and locales methods.
So, a lot of stuff.
But some of those deprecated items might still be lurking in ours projects. Maybe we’ve avoided looking that Deprecation Warnings sections of Utilities in the Craft control panel. Or new deprecation warnings popped up because some old code wasn’t called frequently.
|Config settings||Eight config settings are going away in Craft.||Learn more|
|PHP Constants||For plugin developers, two Craft PHP constants have changed.||Learn more|
|Template Tags||Some template tags related to including assets will be removed or changed.||Learn more|
|Template Functions||Several template functions are going away completely, while others will have replacements. Too many to list!||Learn more|
|Element Queries||This is where you’ll likely have the majority of your deprecation warnings throughout your Twig templates. The big one is treating queries as arrays. Use ||Learn more|
|Elements||One change with the tag element and the removal of the locale properties from all elements (because of multi-site in Craft 3)||Learn more|
Note: This does not cover changes to plugin development in Craft 4.
For any projects you plan to update to Craft 4, you should plan to have them on the latest Craft 3 before the update. The goal is to make the upgrade gulf between version 3 and 4 as small as possible.
Craft 3 releases will end at 3.7.x (i.e. no Craft 3.8) and after Craft 4 will only be security updates. If you have a project that isn’t yet on Craft 3.7, now is the opportune time to update it.
In February 2022, Pixel & Tonic bumped up the minimum PHP requirement to PHP 8.0.2. Before you plan to update a project to Craft 4, check that your current production hosting environment supports PHP 8.0.2.
Every plugin you use in your projects will need an update to it to make it compatible with Craft 4. Your ability to update a project to Craft 4 will depend on a required plugin’s support of Craft 4.
I recommend you or your team make a kanban board (or whatever you use to track project work) just for the update to Craft 4. Create a card for each item required to update to Craft 4: one card for each plugin you use, one for your hosting environment’s support of PHP 8.0.2, etc.
There will be a beta period for Craft 4, last at least a couple of months, that will give all plugin developers time to update their plugins. However, some plugin authors will choose not to update their plugins. You’ll want to plan for alternatives, if that’s the case.