Skip to main content

Update

Update components

To update Thelia components just execute this command

composer update thelia/thelia-skeleton 2.5.0

Update database

Then update you can update your database with this script

php local/setup/update.php

Migrate from Thelia < 2.4 to 2.5

Module made for Thelia <= 2.4 are not compatible with the new version of Thelia, but there is no lot of change to make it compatible.

Module

  • Some functions in BaseModule had their return type set, because you are overwriting them you need to set their return type as well
  • If you want to enable autowiring in your module you must add this function in your base class :
public static function configureServices(ServicesConfigurator $servicesConfigurator): void
{
$servicesConfigurator->load(self::getModuleCode().'\\', __DIR__)
->exclude([THELIA_MODULE_DIR . ucfirst(self::getModuleCode()). "/I18n/*"])
->autowire(true)
->autoconfigure(true);
}

Propel

  • In schema.xml change the database name from Thelia to TheliaMain
  • If some model has been generated by Propel in Model/Base and Model/Map remove these two folders, they are now generated in the cache

Forms

  • Form type alias name doesn't work anymore, you have to use the fully qualified class name, like TextType::class instead of text
  • For choices parameter in choice type invert the label and value
  • The getName() must be static
  • Form name must not contain dot . replace it with an underscore _ (don't forget to replace it in your templates)
  • The callback constraints structure has changed
  • In controllers don't call new MyForm(); to create your form but createForm(FormClassName::getName())

Dispatcher

  • Arguments in dispatch function are inverted, the event object is the first argument and event name is the second

Smarty

  • If you try to access to a not defined variable in Smarty it will now throw an error, you have to either do a check before using it or adding a default value like this {$var|default:null}