J3.x

Joomla 3.10 Backports

From Joomla! Documentation

Revision as of 05:37, 17 October 2020 by M-b-o (talk | contribs) (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
English

This document tracks backports implemented in 3.10 to have a better integration for extension developers with Joomla! 4.

Add support for non prefixed language files[edit]

PR: https://github.com/joomla/joomla-cms/pull/19353

This PR adds support for non prefixed language files to Joomla 3.10. This means you can now use prefixed as well as non-prefixed language files the same as you can do that in 4.0.

Example (prefixed language files)[edit]

/language/en-GB/en-GB.com_admin.ini
/language/en-GB/en-GB.com_admin.sys.ini

Example (non-prefixed language files)[edit]

/language/en-GB/com_admin.ini
/language/en-GB/com_admin.sys.ini

Switcher field transition[edit]

PR: https://github.com/joomla/joomla-cms/pull/30078

With 4.0 a new layout for the radio button has been implemented. With this change in 3.10 we backported the layoutfile, while keeping the original layout, so you can use the same layout definition (`layout="joomla.form.field.radio.switcher"`) in 3.10 and 4.x

Example[edit]

<field
	name="switchertest"
	type="radio"
	label="switcher test"
	class="btn-group btn-group-yesno"
	layout="joomla.form.field.radio.switcher"
	default="1"
>
	<option value="1">JYES</option>
	<option value="0">JNO</option>
</field>

Backport Categories Classes[edit]

PR: https://github.com/joomla/joomla-cms/pull/30346

With the changes from that PR you now can use the same classnames in 3.10 and 4.x. An example how to use it can be found here: https://github.com/joomla/joomla-cms/pull/30346#issuecomment-685424752

Table _supportNullValue handling[edit]

PR: https://github.com/joomla/joomla-cms/pull/30102

With that change to the Joomla\CMS\Table class you can use the `$_supportNullValue` option from 4.x to indicate that the columns fully support the NULL value in the database.

Preparing 3.10 for 4.0 content versioning[edit]

PR: https://github.com/joomla/joomla-cms/pull/29584

This PR backports a few classes that would be necessary to implement versioning of content items in the same code for extensions in 3.x and 4.0. To support both 3.x-style and 4.0-style versioning, you'd have to implement the 3.x-style first. To get 4.0-style working, simply let your table class implement the interface VersionableTableInterface (and the method that that defines) and let your item controller and model use the respective Versionable trait. In 3.x, these traits are empty, in 4.0 they contain all the logic necessary for versioning.