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.xmlchange the database name fromTheliatoTheliaMain - If some model has been generated by Propel in
Model/BaseandModel/Mapremove 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::classinstead oftext - For
choicesparameter in choice type invert thelabelandvalue - 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 butcreateForm(FormClassName::getName())
Dispatcher
- Arguments in dispatch function are inverted, the
event objectis the first argument andevent nameis 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}