CraftCMS v4.3.0 Release Notes

Release Date: 2022-10-25 // over 1 year ago
  • Content Management

    • ➕ Added a “View” menu to element indexes, which enable users to customize the visible table columns for themselves, without affecting other users. (#11915)
    • ➕ Added source setting menus to element index pages, which now contain the “Customize sources” option when allowed, and “New subfolder”, “Rename folder”, and “Delete folder” actions on the Assets index page. (#11906)
    • ➕ Added the “Editable” rule to asset and entry conditions. (#11995)
    • 👌 Improved control panel mobile support. (#11963, #12005)
    • Element indexes now respect field layouts’ user conditions when determining which custom field columns to show. (#11913)
    • Element index URLs now include the selected source key in a source query param, so all sources are now deep-linkable, including custom sources. (#11996)
    • 🍱 Notifications are now shown after executing folder actions on the Assets index page. (#11906)
    • 👍 Date range condition rules now support “Today”, “This week”, “This month”, “This year”, “Past 7 days”, “Past 30 days”, “Past 30 days”, “Past year”, “Before…”, and “After…” relative range types, in addition to specifying a custom date range. (#10749, #11888)
    • 👍 Number condition rules now support an “is between…” operator. (#11950)
    • 👍 All text, number, and date range condition rules now support “has a value” and “is empty” operators. (#11070)
    • “Save as a new [element type]” actions will now discard any unsaved changes on the original element after the new element is created. (#10204, #11959, #12102, #12165)
    • If Live Preview is triggered while a draft is saving, it will now wait until the save completes before opening. (#11858, #11895)
    • ➕ Addresses now support change tracking.
    • ⏪ It’s now possible to restore assets that were deleted programmatically with craft\elements\Asset::$keepFile set to true. (#11761)

    Accessibility

    • 👌 Improved the styling of selected sidebar navigation items to meet contrast requirements. (#11589)
    • 👌 Improved the styling of slideouts for screens under 600 pixels wide. (#11636)
    • 👌 Improved the styling of the primary button on element index pages for small screens. (#11963)
    • 👌 Improved the contrast of modal resize handles. (#11727)
    • 👌 Improved the contrast of fields’ searchable and translatable indicator icons on the Fields index page. (#12169)
    • Improed the contrast of the “Same as language” text within the “Formatting Locale” user preference. (#11767)
    • 👌 Improved the contrast of the selected options within combo boxes. (#11662)
    • 👌 Improved the readability of the global navigation and date pickers when text is resized to 200%. (#11767)
    • 👌 Improved focus management for HUD components. (#11985)
    • 👌 Improved focus management for element index pagination links. (#11565).
    • 👌 Improved focus management for editable tables. (#11662)
    • 👍 Custom slider components now support Home and End key presses. (#11578)
    • 👌 Improved the markup and keyboard control for exclusive button groups. (#11942)
    • 👌 Improved keyboard control for the widget manager HUD on the Dashboard. (#11578)
    • 👌 Improved New Widget and Quick Post action menus for screen readers. (#11611)
    • 👌 Improved the widget manager HUD for screen readers. (#11945)
    • 👌 Improved the Craft Support widget for screen readers. (#11703)
    • 👌 Improved element index view mode buttons for screen readers. (#11613)
    • 👌 Improved element type selects within “Related To” condition rules for screen readers. (#11662)
    • 👌 Improved element action modals for screen readers. (#11905)
    • 👌 Improved field instructions, errors, and other visually-related text for screen readers. (#11763)
    • 👌 Improved field translation indicators for screen readers. (#11662)
    • 👌 Improved the parent selection button on structured entries’ and categories’ edit pages for screen readers. (#11662)
    • 👌 Improved the Rotate button within Live Preview for screen readers. (#11953)
    • 👌 Improved Date fields for screen readers. (#10546)
    • 🛠 Fixed a mismatch between the visible and accessibile text on the site name in the global sidebar. (#11767)
    • ➕ Added alternative text to element status indicators. (#11604)
    • Feed, Recent Entries, and Drafts widgets now use use semantic lists instead of tables. (#11952)
    • ➕ Added autocomplete attributes to several address fields. (#11767)
    • Implemented fieldsets and descriptive headings on user accounts’ “Preferences” tab. (#11534)
    • The “All” status option within element index toolbars now uses a differentiated gradient icon. (#11911)
    • 👌 Improved status indicator shapes, when the “Use shapes to represent statuses” user preference is enabled. (#11911)
    • Boolean table columns within element indexes now use check icons to indicate true values. (#11911)
    • Element titles are no longer truncated on edit pages. (#11768)
    • Asset titles are no longer truncated in asset indexes. (#11775)
    • Element source navigation now programmatically conveys structure imparted by headings. (#11777)
    • ➕ Added a warning icon to related elements that contain validation errors. (#11610)
    • Element index footers now stick to the bottom of the window, and element action triggers are now inserted into the footer rather than replacing the contents of the page’s toolbar. (#11844)

    Administration

    • ➕ Added the extraLastNamePrefixes config setting. (#11903)
    • ➕ Added the extraNameSalutations config setting. (#11903)
    • ➕ Added the extraNameSuffixes config setting. (#11903)
    • 0️⃣ Element sources now have a “Default Sort” setting in the Customize Sources modal. (#12002)
    • Control panel-defined image transforms can now have custom quality values. (#9622)
    • Added support for the CRAFT_DOTENV_PATH PHP constant. (#11894)
    • 🌐 Added support for CRAFT_WEB_URL and CRAFT_WEB_ROOT environment variables/PHP constants, which can be used to set the default @web and @webroot alias values. (#11912)

    Development

    • ➕ Added the canCreateDrafts() Twig function. (#11797, #11808)
    • ➕ Added the canDelete() Twig function. (#11797, #11808)
    • ➕ Added the canDeleteForSite() Twig function. (#11797, #11808)
    • ➕ Added the canDuplicate() Twig function. (#11797, #11808)
    • ➕ Added the canSave() Twig function. (#11797, #11808)
    • ➕ Added the canView() Twig function. (#11797, #11808)
    • ➕ Added the |boolean Twig filter. (#11792)
    • ➕ Added the |float Twig filter. (#11792)
    • ➕ Added the |integer Twig filter. (#11792)
    • ➕ Added the |string Twig filter. (#11792)
    • Twig templates now have today, tomorrow, and yesterday global variables available to them.
    • 👍 Element query date params now support passing today, tomorrow, and yesterday. (#10485)
    • Element queries’ relatedTo params now only check for relations in the same site as siteId, if set. (#12000, #12072)
    • 👍 Element queries now support passing ambiguous column names (e.g. dateCreated) and field handles into select(). (#11790, #11800)
    • 👍 Element queries’ collect() methods eager-loaded elements now return craft\elements\ElementCollection objects, which extends Illuminate\Support\Collection with ids() and with() methods. (#12113)
    • {% cache %} tags now store any HTML registered with {% html %} tags. (#11811)
    • {% cache %} tags and GraphQL query caches now get a max cache duration based on the fetched/referenced entries’ expiry dates. (#8525, #11901)
    • ➕ Added the siteHandle field to elements queried via GraphQL. (#10829)
    • users/session-info responses now include a csrfTokenName key. (#11706, #11767)
    • 👍 The elements/save-draft action now supports being called from the front end. (#12131)
    • The users/upload-user-photo action now includes a photoId key in the response data. (#12175)

    Extensibility

    • ➕ Added craft\base\conditions\BaseTextConditionRule::inputOptions().
    • Added craft\base\Element::EVENT_DEFINE_URL. (#12168)
    • ➕ Added craft\base\ExpirableElementInterface. (#11901)
    • ➕ Added craft\controllers\ElementsController::$element.
    • ➕ Added craft\db\ActiveQuery::collect(). (#11842)
    • ➕ Added craft\elements\actions\Restore::$restorableElementsOnly.
    • ➕ Added craft\elements\conditions\assets\EditableConditionRule.
    • ➕ Added craft\elements\conditions\entries\EditableConditionRule.
    • ➕ Added craft\elements\ElementCollection. (#12113)
    • ➕ Added craft\events\AuthorizationCheckEvent::$element.
    • ➕ Added craft\events\CreateTwigEvent.
    • ➕ Added craft\events\DefineAddressFieldLabelEvent.
    • ➕ Added craft\events\DefineAddressFieldsEvent.
    • ➕ Added craft\events\DefineUrlEvent. (#12168)
    • ➕ Added craft\events\ImageTransformerOperationEvent::$tempPath.
    • ➕ Added craft\events\SearchEvent::$scores. (#11882)
    • ➕ Added craft\events\UserGroupPermissionsEvent.
    • ➕ Added craft\events\UserPermissionsEvent.
    • ➕ Added craft\helpers\DateRange.
    • ➕ Added craft\helpers\DateTimeHelper::firstWeekDay().
    • ➕ Added craft\helpers\DateTimeHelper::lastMonth().
    • ➕ Added craft\helpers\DateTimeHelper::lastWeek().
    • ➕ Added craft\helpers\DateTimeHelper::lastWeekDay().
    • ➕ Added craft\helpers\DateTimeHelper::lastYear().
    • ➕ Added craft\helpers\DateTimeHelper::nextMonth().
    • ➕ Added craft\helpers\DateTimeHelper::nextWeek().
    • ➕ Added craft\helpers\DateTimeHelper::nextYear().
    • ➕ Added craft\helpers\DateTimeHelper::thisMonth().
    • ➕ Added craft\helpers\DateTimeHelper::thisWeek().
    • ➕ Added craft\helpers\DateTimeHelper::thisYear().
    • ➕ Added craft\helpers\DateTimeHelper::today().
    • ➕ Added craft\helpers\DateTimeHelper::tomorrow().
    • ➕ Added craft\helpers\DateTimeHelper::yesterday().
    • ➕ Added craft\helpers\ElementHelper::attributeHtml().
    • ➕ Added craft\helpers\Html::svg(). (#11932)
    • ➕ Added craft\i18n\FormatConverter::convertDatePhpToHuman(). (#10546)
    • ➕ Added craft\i18n\Locale::FORMAT_HUMAN.
    • ➕ Added craft\nameparsing\CustomLanguage.
    • Added craft\services\Addresses::EVENT_DEFINE_FIELD_LABEL. (#11788)
    • Added craft\services\Addresses::EVENT_DEFINE_USED_FIELDS. (#11788)
    • Added craft\services\Addresses::EVENT_DEFINE_USED_SUBDIVISION_FIELDS. (#11788)
    • ➕ Added craft\services\Addresses::getFieldLabel().
    • ➕ Added craft\services\Addresses::getUsedFields().
    • ➕ Added craft\services\Addresses::getUsedSubdivisionFields().
    • Added craft\services\Elements::EVENT_AUTHORIZE_CREATE_DRAFTS. (#11759, #11808)
    • Added craft\services\Elements::EVENT_AUTHORIZE_DELETE_FOR_SITE. (#11759, #11808)
    • Added craft\services\Elements::EVENT_AUTHORIZE_DELETE. (#11759, #11808)
    • Added craft\services\Elements::EVENT_AUTHORIZE_DUPLICATE. (#11759, #11808)
    • Added craft\services\Elements::EVENT_AUTHORIZE_SAVE. (#11759, #11808)
    • Added craft\services\Elements::EVENT_AUTHORIZE_VIEW. (#11759, #11808)
    • ➕ Added craft\services\Elements::canCreateDrafts().
    • ➕ Added craft\services\Elements::canDelete().
    • ➕ Added craft\services\Elements::canDeleteForSite().
    • ➕ Added craft\services\Elements::canDuplicate().
    • ➕ Added craft\services\Elements::canSave().
    • ➕ Added craft\services\Elements::canView().
    • ➕ Added craft\services\Elements::getIsCollectingCacheInfo(). (#11901)
    • ➕ Added craft\services\Elements::setCacheExpiryDate(). (#11901)
    • ➕ Added craft\services\Elements::startCollectingCacheInfo(). (#11901)
    • ➕ Added craft\services\Elements::stopCollectingCacheInfo(). (#11901)
    • Added craft\services\Search::EVENT_BEFORE_SCORE_RESULTS. (#11882)
    • Added craft\services\UserPermissions::EVENT_AFTER_SAVE_GROUP_PERMISSIONS. (#12130, #12146)
    • Added craft\services\UserPermissions::EVENT_AFTER_SAVE_USER_PERMISSIONS. (#12130, #12146)
    • ➕ Added craft\web\Controller::currentUser(). (#11754, #11916)
    • Added craft\web\View::EVENT_AFTER_CREATE_TWIG. (#11774)
    • craft\elements\Asset::EVENT_DEFINE_URL now gets triggered after the default URL has been generated, and the URL will be passed to craft\events\DefineAssetUrlEvent::$url.
    • craft\elements\db\ElementQuery::collect() and craft\base\Element::getEagerLoadedElements() now return craft\elements\ElementCollection instances. (#12113)
    • craft\events\DraftEvent::$creatorId is now nullable. (#11904)
    • craft\fieldlayoutelements\BaseField::statusClass() and statusLabel() now return status info from the element for the attribute specified by attribute().
    • craft\helpers\Component::iconSvg() now namespaces the SVG contents, and adds aria-hidden="true". (#11703)
    • craft\services\Drafts::createDraft() now accepts null passed to its $creatorId argument. (#11904)
    • craft\services\Search::EVENT_AFTER_SEARCH now includes the computed search result scores, set to craft\events\SearchEvent::$scores, and any changes made to it will be returned by searchElements(). (#11882)
    • craft\services\Search::EVENT_BEFORE_INDEX_KEYWORDS is now cancellable by setting $event->isValid to false. (#11705)
    • Deprecated craft\base\Element::EVENT_AUTHORIZE_CREATE_DRAFTS. craft\services\Elements::EVENT_AUTHORIZE_CREATE_DRAFTS should be used instead.
    • Deprecated craft\base\Element::EVENT_AUTHORIZE_DELETE_FOR_SITE. craft\services\Elements::EVENT_AUTHORIZE_DELETE_FOR_SITE should be used instead.
    • Deprecated craft\base\Element::EVENT_AUTHORIZE_DELETE. craft\services\Elements::EVENT_AUTHORIZE_DELETE should be used instead.
    • Deprecated craft\base\Element::EVENT_AUTHORIZE_DUPLICATE. craft\services\Elements::EVENT_AUTHORIZE_DUPLICATE should be used instead.
    • Deprecated craft\base\Element::EVENT_AUTHORIZE_SAVE. craft\services\Elements::EVENT_AUTHORIZE_SAVE should be used instead.
    • Deprecated craft\base\Element::EVENT_AUTHORIZE_VIEW. craft\services\Elements::EVENT_AUTHORIZE_VIEW should be used instead.
    • 🗄 Deprecated craft\elements\Address::addressAttributeLabel(). craft\services\Addresses::getFieldLabel() should be used instead.
    • 🗄 Deprecated craft\events\DefineAssetUrlEvent::$asset. $sender should be used instead.
    • 🗄 Deprecated craft\services\Elements::getIsCollectingCacheTags(). getIsCollectingCacheInfo() should be used instead. (#11901)
    • 🗄 Deprecated craft\services\Elements::startCollectingCacheTags(). startCollectingCacheInfo() should be used instead. (#11901)
    • 🗄 Deprecated craft\services\Elements::stopCollectingCacheTags(). stopCollectingCacheInfo() should be used instead. (#11901)
    • checkboxSelect inputs without showAllOption: true now post an empty value if no options were selected. (#11748)
    • ➕ Added the Craft.useMobileStyles() JavaScript method. (#11636)
    • ➕ Added Craft.BaseElementIndex::getParentSource().
    • ➕ Added Craft.BaseElementIndex::getRootSource().
    • ➕ Added Craft.BaseElementIndex::getSourceActions(). (#11906)
    • ➕ Added Craft.BaseElementIndex::getSourceLevel().
    • 👀 Craft.BaseElementSelectInput now triggers a change event when elements are added programmatically or removed.

    System

    • 📜 Name parsing now checks for common German salutations, suffixes, and last name prefixes.
    • 👷 “Generating pending image transforms” jobs no longer attempt to process transforms that had previously failed. (#11970)
    • 0️⃣ The default system email template now sets the lang attribute on the <html> tag. (#12156)
    • 0️⃣ The default system email template now includes a Content-Type tag. (#12156)
    • 👌 Improved GraphQL cache reliability. (#11994, #12086)
    • Control panel .twig templates are now prioritized over .html. (#11809, #11840)
    • ⚡️ Updated Yii to 2.0.46.
    • 🛠 Fixed a bug where addresses weren’t validating their country codes. (#12161)
    • 🛠 Fixed a bug where Entry URI Format, Template, and Default Status switches were focusable within sections’ Site Settings tables, for disabled sites.
    • 🛠 Fixed a bug where craft\helpers\Db::parseParam() wasn’t generating conditions that would include null values when it should have. (#11931)