Contao news

Read the official Contao announcements.

Contao 3.2.beta1 is available

by Leo Feyer – Announcements

Contao version 3.2.beta1 is available. Please do not use beta versions for productional websites! Download the release to check whether your website or custom extension needs adaptation.

Version 3.2 as the new LTS release will accompany us for 18 months, therefore we are developing it under the motto "evolution, not revolution". Instead of possibly adding 200 new features, we are trying to stabilize and to perfect the features which have been added in Contao 3.

The new features, which have still been added, for example the usage of UUIDs for files, were all rather complex and not trivial to implement. All the more important that the two pre releases (beta1 and RC1) are extensively tested.

Here are some of the highlight features in the new version. For a complete list, please read the changelog or check out the closed tickets of the release milestone (see the links at the end of the announcement).

Unique file IDs

The database-aided file system, which has been added in Contao 3, stores file information in the database and references the entries via their ID. However, this can lead to problems with tools such as syncCto, when certain IDs exist on the local computer as well as on the server, each referencing a different file.

To prevent those problems, we are using UUIDs (Universally Unique Identifier) in Contao 3.2. A UUID is unique across systems and e.g. looks like this: bb643d42-0026-ba97-11e3-ccd717221c8a

Normally, users do not get in touch with the UUID, because files are selected with the file picker in Contao. The only exception is the "file" insert tag, which now also supports UUIDs:

<img src="{{file::bb643d42-0026-ba97-11e3-ccd717221c8a}}" alt="">

The insert tag is replaced with the path to the referenced file.

Closures in DCAs and templates

Closures are anonymous functions, which have been introduced in PHP 5.3. In Contao 3.2, they can be used instead of the usual callbacks in the Data Container Array as well as in templates.

// Callback definition
$GLOBALS['TL_DCA']['tl_page'] = array
(
	'list' => array
	(
		'label' => array
		(
			'label_callback' => array('tl_page', 'addIcon')
		)
	)
);

// Class and method definition
class tl_page extends Backend
{
	public function addIcon($params)
	{
		return Backend::addPageIcon($params);
	}
}

Alternatively, you can now use closures at this point:

// Callback definition
$GLOBALS['TL_DCA']['tl_page'] = array
(
	'list' => array
	(
		'label' => array
		(
			'label_callback' => function($params)
			{
				return Backend::addPageIcon($params);
			}
		)
	)
);

Following the same principle, you can also add closures to templates:

// Template assignment
$objTemplate = new FrontendTemplate('ce_test');
$objTemplate->sum = function($a, $b) { return $a + $b; };
$objTemplate->output();

// Usage in the template
<?php echo $this->sum(3, 5); ?>

Proxy server support

The proxy server support has been highly improved in Contao 3.2.

  • You can now enter a list of trusted proxy server IPs in the back end settings to improve filtering the user's IP address from an eventually existing list of proxy server IP addresses.
  • If you are using an SSL proxy server and if you have added its domain name in the settings, Contao will recognize it and adjust the URL generation accordingly based on the request headers.

In case you had to adjust the $_SERVER array to use Contao with a proxy server, you should try if it works without those adjustments after the upgrade.

Making debugging easier

From now on, Contao will always show error messages once you have logged into the install tool. This also applies if the "display error messages" setting has been disabled and the application is showing the generic error screens instead of the actual error message.

system/docs/UPGRADE.md

The new system/docs/UPGRADE.md file is used to document API changes which are not backwards compatible. These kind of API changes are generally allowed in major versions only, though it is not always possible to avoid them in minor releases. In the current case, the "buttons_callback" has been enhanced with some important functions, which however require an API change.

Linking your Google+ profile

Back end users can add their Google+ profile ID in Contao 3.2, so their articles (e.g. news and FAQs) are linked with their Google+ profile automatically. This causes Google to show their Google+ profile picture in the search results (after they have activated the feature in the Google+ settings).

Case-sensitive usernames

So far, usernames in Contao have been case-insensitive due to the default database collation. Loggin in as "k.jones" was also possible as "K.JONES" or "k.joNEs". In Contao 3.2, this has been changed, so "k.jones" and "K.JONES" might eventually be two different users.

Show all news

Comments

Add a comment

What is the sum of 2 and 3?