Using the FORM_FIELDS mechanism to determine which form fields have been
submitted has been deprecated in Contao 4.0 and will no longer work in Contao
5.0. Make sure to always submit at least an empty string in your widget.
<!-- Wrong: the input will only be submitted if checked -->
<input type="checkbox" name="foo" value="bar">
<!-- Right: the input will always be submitted -->
<input type="hidden" name="foo" value=""><input type="checkbox" name="foo" value="bar">Using a custom page handler without a getResponse() method has been
deprecated in Contao 4.0 and will no longer work in Contao 5.0.
The VERSION and BUILD constants have been deprecated in Contao 4.0 and will
be removed in Contao 5.0. Use the kernel.packages parameter instead.
$packages = System::getContainer()->getParameter('kernel.packages');
$coreVersion = $packages['contao/core-bundle'];Accessing the field groups via one of the following properties in the
member_grouped.html5 template has been deprecated in Contao 4.0 and will no
longer work in Contao 5.0:
$this->personal$this->address$this->contact$this->login$this->captcha
Use $this->categories instead.
Using the simple token "channel" in newsletter subscription mails has been deprecated in Contao 4.0 and will no longer work in Contao 5.0. Use the "channels" token instead.
Using $this->arrCache, which is defined in the System class, has been
deprecated in Contao 4.0 and will no longer work in Contao 5.0. If you are
using it in your class, make sure to define it as property.
Using $this->items in pagination templates has been deprecated in Contao 4.0
and will no longer work in Contao 5.0. Use $this->pages instead.
The constants TL_SCRIPT_URL and TL_PLUGINS_URL have been deprecated in
Contao 4.0 and will be removed in Contao 5.0. Use TL_ASSETS_URL instead.
The UnresolvableDependenciesException class has been deprecated in Contao 4.0
and will be removed in Contao 5.0.
Using $this->language in TinyMCE configuration files has been deprecated in
Contao 4.0 and will no longer work in Contao 5.0. Use the static method
Backend::getTinyMceLanguage() instead.
Using the globals $GLOBALS['TL_LANGUAGE'] and $_SESSION['TL_LANGUAGE'] has
been deprecated in Contao 4.0 and will no longer work in Contao 5.0. Use the
locale from the request object instead:
$locale = System::getContainer()->get('request_stack')->getCurrentRequest()->getLocale();Using the old Request.Mixed class instead of Request.Contao has been deprecated in Contao 4.0 and will no longer work in Contao 5.0.
The "subpalette" event, which is currently fired when a subpalette is toggled via Ajax, has been deprecated in Contao 4.0 and will be removed in Contao 5.0. Subscribe to the "ajax_change" event instead.
The Session class has been deprecated in Contao 4.0 and will be removed in
Contao 5.0. Use the session service instead:
$session = System::getContainer()->get('session');The Widget::addSubmit() method has been deprecated in Contao 4.0 and will be
removed in Contao 5.0. It already does not add a submit button anymore.
For reasons of backwards compatibility, it is currently not required to set the
tl_content.ptable column; it will treat an empty column like it had been set
to tl_article.
This behavior has been deprecated in Contao 4.0 and will no longer be supported
in Contao 5.0. If you have developed an extension which creates content
elements, make sure to always set the ptable column.
Even though we are still using the Contao class loader, it has been deprecated in favor of the Composer class loader. You should no longer use it and you can no longer use it to override arbitrary core classes.
Using $this in configuration files such as config/config.php or dca/*.php
has been deprecated in Contao 4.0 and will no longer work in Contao 5.0.
You can use the static helper methods such as System::loadLanguageFile() or
Controller::loadDataContainer() instead.
The constants TL_ROOT, TL_MODE, TL_START, TL_SCRIPT and TL_REFERER_ID
have been deprecated and will be removed in Contao 5.0.
Use the kernel.root_dir instead of TL_ROOT:
$rootDir = dirname(System::getContainer()->getParameter('kernel.root_dir'));Use the ScopeAwareTrait trait instead of using TL_MODE:
use Contao\CoreBundle\Framework\ScopeAwareTrait;
class Test {
use ScopeAwareTrait;
public function isBackend() {
return $this->isBackendScope();
}
public function isFrontend() {
return $this->isFrontendScope();
}
}Use the kernel start time instead of TL_START:
$startTime = System::getContainer()->get('kernel')->getStartTime();Use the request stack to get the route instead of using TL_SCRIPT:
$route = System::getContainer()->get('request_stack')->getCurrentRequest()->get('_route');
if ('contao_backend' === $route) {
// Do something
}Use the the request attribute _contao_referer_id instead of TL_REFERER_ID:
$refererId = System::getContainer()->get('request_stack')->getCurrentRequest()->get('_contao_referer_id');Contao 4 only uses a single PHP entry point, namely the app.php or
app_dev.php file. The previous PHP entry points have been removed and a route
has been set up for each one instead (see UPGRADE.md).
Using the old paths is deprecated and will no longer work in Contao 5.0.
The ModuleLoader class is no longer used and only kept for reasons of
backwards compatibility. It is deprecated and will be removed in Contao 5.0.
Use the container parameter kernel.bundles instead:
$bundles = System::getContainer()->getParameter('kernel.bundles');Using database.sql files to set up tables is deprecated in Contao 4.0 and
will no longer be supported in Contao 5.0. Use DCA files instead:
$GLOBALS['TL_DCA']['tl_example'] = array
(
'config' => array
(
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'name' => 'unique'
)
)
),
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'name' => array
(
'sql' => "varchar(32) NULL"
),
'value' => array
(
'sql' => "varchar(32) NOT NULL default ''"
)
)
);