New in Craft CMS 2.6
Yesterday Craft CMS 2.6 and Craft Commerce 1.1 were released. The biggest new feature in this release is the support of Eager Loading for elements. Developers are also happy about new hooks.
Eager Loading
Eager Loading is designed to drastically reduce the number of SQL queries needed to render pages with nested element queries. Eager Loading is the opposite of lazy Loading, as it efficiently fetches all foreseeably required data in the query.
The following elements support eager Loading:
- Relationships per entries, files, users, tags, categories, and commerce product fields
- Matrix blocks
- Commerce product variants
- Image transformation indices
Furthermore, 3rd party elements can use Eager Loading via the new getEagerLoadingMap() method. 3rd party field types can provide eager Loading if they use the IEagerLoadingFieldType interface.
Others
- The new "New Users" widget for the overview page displays the most recently created user accounts.
- AppHelper::normalizeVersionNumber() and getMajorVersion() added.
- ChartHelper added.
- AssetSourcesService::getPublicSources() and getPublicSourceIds() added.
- ElementsService::populateElements(), for populating element models from the results of an elements query generated by ElementsService::buildElementsQuery().
- addRichTextLinkOptions added.
- elements.onPopulateElements event added.