Skip to content

Commit

Permalink
Merge pull request #1822 from jolelievre/notable-changes
Browse files Browse the repository at this point in the history
Document all breaking changes and notable changes in PrestaShop V9
  • Loading branch information
jolelievre authored Jun 11, 2024
2 parents aca39b7 + b7cf0ac commit 4e60f17
Showing 1 changed file with 246 additions and 1 deletion.
247 changes: 246 additions & 1 deletion modules/core-updates/9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,249 @@ menuTitle: Changes in 9.0

## PHP support

PrestaShop 9.0 now requires PHP 8.1 minimum, with support added for PHP 8.2 and 8.3.
PrestaShop 9.0 now requires **PHP 8.1 minimum**, with support added for PHP 8.2 and 8.3.

- [Remove compatibility for php versions inferior to PHP 8.1](https://github.com/PrestaShop/PrestaShop/pull/32514)
- [Support for PHP 8.2](https://github.com/PrestaShop/PrestaShop/pull/29116)
- [Support for PHP 8.3](https://github.com/PrestaShop/PrestaShop/pull/34485)

## Core changes

### Symfony Upgrade

PrestaShop V9 has been upgraded to rely on Symfony 6.4, V8 was previously based on Symfony 4.4 so it's quite a big leap. As such the V9 includes all the breaking changes related to the Symfony Framework, you can see [more details about the changes in the core here](https://github.com/PrestaShop/PrestaShop/issues/33993) and if you can also check Symfony migration guides (see below).
Symfony 6.4 is the latest LTS version and will be supported until November 2026 for bug fixes, and November 2027 for security fixes.

- [UPGRADE FROM 4.4 to 5.0](https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.0.md)
- [UPGRADE FROM 5.0 to 5.1](https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.1.md)
- [UPGRADE FROM 5.1 to 5.2](https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.2.md)
- [UPGRADE FROM 5.2 to 5.3](https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.3.md)
- [UPGRADE FROM 5.3 to 5.4](https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.4.md)
- [UPGRADE FROM 5.3 to 5.4](https://github.com/symfony/symfony/blob/5.4/UPGRADE-5.4.md)
- [UPGRADE FROM 5.X to 6.0](https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.0.md)
- [UPGRADE FROM 6.0 to 6.1](https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.1.md)
- [UPGRADE FROM 6.1 to 6.2](https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.2.md)
- [UPGRADE FROM 6.2 to 6.3](https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.3.md)
- [UPGRADE FROM 6.3 to 6.4](https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.4.md)

### Removed dependencies

We followed Symfony recommendations and no longer use the `symfony/symfony` dependency but instead each sub package manually, the minimum version of PHP 8.1 also forced us to upgrade or removed some dependencies.
We used this occasion to clean the dependencies that are no longer used in the core (whether they are from symfony or not), if you need these dependencies in your modules you will have to integrate them in your module's dependencies.

- `guzzlehttp/guzzle` (replaced by Symfony HTTP client in the core)
- `league/tactician-bundle` (replaced by Symfony Messenger component)
- `pear/archive_tar`
- `sensio/framework-extra-bundle` (we now favor annotations in the core)
- `soundasleep/html2text`
- `swiftmailer/swiftmailer` (replaced by Symfony Mailer component in the core)
- `symfony/inflector`
- `symfony/notifier`
- `symfony/rate-limiter`
- `symfony/semaphore`
- `symfony/uid`
- `symfony/workflow`

### Upgraded dependencies

Some dependencies are still present but were upgraded which comes with their own breaking changes, please refer to each dependency changelog to understand them in details if you depend on these dependencies:

- `api-platform/core`: `2.7.6` -> `3.2.13`
- `composer/installers`: `1.12.0` -> `2.2.0`
- `friendsofsymfony/jsrouting-bundle`: `2.8.0` -> `3.2.1`
- `lcobucci/jwt`: `3.4.6` (special patch from https://github.com/PrestaShop/jwt.git) -> `5.0.0` (no need for fork version anymore)
- `mobiledetect/mobiledetectlib`: `2.8.41` -> `3.74.0`
- `pelago/emogrifier`: `5.0.1` -> `7.0.0`
- Symfony dependencies all upgraded from `4.4` to `6.4`
- `twig/twig`: `3.4.3` -> `3.8.0`
- `doctrine/dbal`: `2.13.8` -> `3.6.5`
- `doctrine/lexer`: `1.2.3` -> `2.1.1`
- `doctrine/orm`: `2.12.1` -> `2.15.5`
- `doctrine/deprecations`: `0.5.3` -> `1.1.3`
- 'egulias/email-validator': `3.2.6` -> `4.0.1`

### Symfony controllers

@todo: explain changes about DI (controllers as services, injected container no longer the same, ...), new PrestaShopAdminController and deprecated FrameworkAdminBundleController

- [Removed method renderForm which is now used by the Symfony framework](https://github.com/PrestaShop/PrestaShop/pull/31994)
- [Maintain backward compatibility FrameworkBundleAdminController, but deprecated](https://github.com/PrestaShop/PrestaShop/pull/32450)
- [Services translator, security.csrf.token_manager, session, session.flash_bag no longer public](https://github.com/PrestaShop/PrestaShop/pull/35069)
- [Replace AdminSecurity annotation with attributes](https://github.com/PrestaShop/PrestaShop/pull/35212)

## Migrated pages

The migration of pages imply several breaking changes, we won't detail all of them for each page but here is a summary:
- the legacy URL is no longer reachable, you are automatically redirected to the migrated page
- the legacy controller is removed along with its associated smarty templates
- the legacy hooks related to controller workflow are no longer called
- the page no longer uses smarty but twig

Here is the list of migrated pages in v9:

- International > Locations > States
- Shop parameters > Order settings > Statuses
- Orders > Shopping Carts
- Sell > Catalog > Attributes
- Sell > Catalog > Feature
- Sell > Catalog > Products (new version of the page introduce in PrestaShop V8 is now the only available one)
- [edition of features use a new optimized data structure in the form](https://github.com/PrestaShop/PrestaShop/pull/34763)

## Breaking Changes

### `trans` method

Following [PrestaShop/PrestaShop#30415](https://github.com/PrestaShop/PrestaShop/pull/30415) the function `trans()` does NOT escape anymore strings. In v8 you could pass parameters like `htmspecialcharacters` or `addslashes` to `trans()` to perform additional escape, but it’s been removed.
It also affects the `l` function in Smarty.

Since [PrestaShop/PrestaShop#30415](https://github.com/PrestaShop/PrestaShop/pull/31900) the `trans` method always keep the behavior it had with the (now removed) `_raw` parameter, meaning the content is not modified anymore. You need to use `htmlspecialchars` on your parameters provided on input and on the returned string if you need to modify it.

### Some front controller now use `Presenter` classes

This changes the data passed to the smarty templates:

- [Category](https://github.com/PrestaShop/PrestaShop/pull/32653)
- [Manufacturer](https://github.com/PrestaShop/PrestaShop/pull/31309)
- [Supplier](https://github.com/PrestaShop/PrestaShop/pull/32634)
- [Store](https://github.com/PrestaShop/PrestaShop/pull/32652)

### Stronger types / change of prototypes

- [PrestaShop\PrestaShop\Core\Product\Search\Pagination](https://github.com/PrestaShop/PrestaShop/pull/31995)
- [Type hint front controllers](https://github.com/PrestaShop/PrestaShop/pull/32846)
- [Strong types in legacy admin controllers](https://github.com/PrestaShop/PrestaShop/pull/34653)

### Symfony layout

@todo explain the new workflow in BO the responsibility of twig components, the difference in how a legacy controller is executed and rendered

- [Smarty variables viewport_scale and inline_js variables no longer present](https://github.com/PrestaShop/PrestaShop/pull/33775)
- [Removed modal_module_list, modals views in new layout](https://github.com/PrestaShop/PrestaShop/pull/33864)
- [Clean Smarty variables that were only relevant for the layout internal use](https://github.com/PrestaShop/PrestaShop/pull/34560)
- [Legacy pages are rendered by Symfony](https://github.com/PrestaShop/PrestaShop/pull/34783)

### BO login and authorization migrated to Symfony

@todo detail the impact of this migration (legacy Cookie no longer usable, CQRS token always used in urls, session stored on server side, ...)

- [Update employee interfaces](https://github.com/PrestaShop/PrestaShop/pull/34818)
- [PS_SSL_ENABLED_EVERYWHERE configuration removed, PS_TRUSTED_PROXIES env variable introduced](https://github.com/PrestaShop/PrestaShop/pull/35761)
- [AdminController::isAnonymousAllowed is now public](https://github.com/PrestaShop/PrestaShop/pull/35810)
- [Login page and authentication migrated](https://github.com/PrestaShop/PrestaShop/pull/35983)

### Symfony context refacto

@todo Explain the new Context service (ADR, usages) that will replace the old Context

- [Modified LanguageInterface and LocaleInterface](https://github.com/PrestaShop/PrestaShop/pull/34500)

### Kernel modifications

@todo Explain the three new kernels and their respective folders for configurations

- [Experimental front container](https://github.com/PrestaShop/PrestaShop/pull/32719)
- [Admin API has dedicated kernel, we now have three distinct configurations](https://github.com/PrestaShop/PrestaShop/pull/35515)

### Change of behaviour/rules or removed code

- [Customization quantity feature has been removed](https://github.com/PrestaShop/PrestaShop/pull/12422), the customization quantity is now the one from the cart_product row
- [Refactor AdminModulesControllers and remove obsolete features](https://github.com/PrestaShop/PrestaShop/pull/27912)
- [Invalid characters are being saved as Social titles](https://github.com/PrestaShop/PrestaShop/pull/29760)
- [AbstractCategoryType constructor changed](https://github.com/PrestaShop/PrestaShop/pull/29951)
- [HTTPs check in BackOffice is now based on Symfony Request::isSecure instead of legacy Tools::usingSecureMode](https://github.com/PrestaShop/PrestaShop/pull/30565)
- [PrestaShopAutoload has been removed in favor of prestashop/autoload](https://github.com/PrestaShop/PrestaShop/pull/31029)
- Form Types/Extensions have been migrated to be autowired and rely on FQCN service names:
- [https://github.com/PrestaShop/PrestaShop/pull/31138](https://github.com/PrestaShop/PrestaShop/pull/31138)
- [https://github.com/PrestaShop/PrestaShop/pull/31193](https://github.com/PrestaShop/PrestaShop/pull/31193)
- [https://github.com/PrestaShop/PrestaShop/pull/31391](https://github.com/PrestaShop/PrestaShop/pull/31391)
- [Enable/disable module on mobile feature was removed](https://github.com/PrestaShop/PrestaShop/pull/31151)
- [Standardize filterManufacturerContent hook](https://github.com/PrestaShop/PrestaShop/pull/31531)
- [Legacy images format no longer supported](https://github.com/PrestaShop/PrestaShop/pull/31311)
- [PrestaShopBundle\Kernel\ModuleRepository was removed along with its Factory](https://github.com/PrestaShop/PrestaShop/pull/31418)
- [Product::getDefaultCategory always returns an int](https://github.com/PrestaShop/PrestaShop/pull/31752)
- [Remove high DPI images feature](https://github.com/PrestaShop/PrestaShop/pull/32446)
- [Remove Category menu thumbnail feature](https://github.com/PrestaShop/PrestaShop/pull/32458)
- [Symfony Parameter prestashop.addons.categories was removed](https://github.com/PrestaShop/PrestaShop/pull/32496)
- [UpdateHookStatusCommand parameter is no the new expected status](https://github.com/PrestaShop/PrestaShop/pull/32669)
- [Replaced SwiftMailer by Symfony Mailer](https://github.com/PrestaShop/PrestaShop/pull/32736)
- [Replaced TactitianBundle by Symfony Messenger](https://github.com/PrestaShop/PrestaShop/pull/32787)
- [Removed Advanced Stock Management remains](https://github.com/PrestaShop/PrestaShop/pull/33158)
- [Remove shop activity during install](https://github.com/PrestaShop/PrestaShop/pull/33232)
- [Remove Multi Address delivery](https://github.com/PrestaShop/PrestaShop/pull/33264)
- [Remove non responsive component in BO](https://github.com/PrestaShop/PrestaShop/pull/33324)
- [Lazy load Product feature in FO](https://github.com/PrestaShop/PrestaShop/pull/33335)
- [Removed cover_image_id from Product lazy array](https://github.com/PrestaShop/PrestaShop/pull/33363)
- [Removed attribute_price from Product::getProductProperties](https://github.com/PrestaShop/PrestaShop/pull/33435)
- [Doctrine dependencies updated](https://github.com/PrestaShop/PrestaShop/pull/33459)
- [FrontController::addJqueryUi no only adds the requested component](https://github.com/PrestaShop/PrestaShop/pull/33563)
- [Removed code from old product page](https://github.com/PrestaShop/PrestaShop/pull/33587)
- [ObjectModel fields definition can contain translatable wording](https://github.com/PrestaShop/PrestaShop/pull/33624)
- [Always enable experimental feature for images](https://github.com/PrestaShop/PrestaShop/pull/34172)
- [Forbid sensitive files in modules directory](https://github.com/PrestaShop/PrestaShop/pull/34184)
- [Remove legacy tab system](https://github.com/PrestaShop/PrestaShop/pull/34290)
- [Upgrade jquery to latest version, drop polyfills](https://github.com/PrestaShop/PrestaShop/pull/34382)
- [EmployeeId has strict type, OrderStatusForViewing has new constructor parameters](https://github.com/PrestaShop/PrestaShop/pull/35292)
- [RedirectTargetProvider and ProductRedirectTarget moved into generic namespace](https://github.com/PrestaShop/PrestaShop/pull/35608)
- [Changed return types of all ean13 properties in CQRS](https://github.com/PrestaShop/PrestaShop/pull/35697)
- [ModuleManagerBuilder and ThemeManager internal properties no longer public](https://github.com/PrestaShop/PrestaShop/pull/35716)
- [Admin API, lots of experimental code renamed](https://github.com/PrestaShop/PrestaShop/pull/35772)
- [Empty value no longer allowed for redirect_type in product tables](https://github.com/PrestaShop/PrestaShop/pull/35996)
- [PHPStan Doctrine extension introduced that impact all existing Entities](https://github.com/PrestaShop/PrestaShop/pull/36021)

### Removal of deprecated code

- [Remove TextEmptyType and TextareaEmptyType](https://github.com/PrestaShop/PrestaShop/pull/28532)
- [Removed deprecated methods in Order class](https://github.com/PrestaShop/PrestaShop/pull/28550)
- Remove deprecated code in Adapter namespace
- [https://github.com/PrestaShop/PrestaShop/pull/28564](https://github.com/PrestaShop/PrestaShop/pull/28564)
- [https://github.com/PrestaShop/PrestaShop/pull/31894](https://github.com/PrestaShop/PrestaShop/pull/31894)
- Remove deprecated code in Core namespace
- [Remove classes](https://github.com/PrestaShop/PrestaShop/pull/28988)
- [Remove SearchParameters](https://github.com/PrestaShop/PrestaShop/pull/32691)
- Removal or renaming of Symfony services:
- https://github.com/PrestaShop/PrestaShop/pull/32167
- https://github.com/PrestaShop/PrestaShop/pull/32340
- [remove deprecated endpoint admin-dev/get-file-admin.php](https://github.com/PrestaShop/PrestaShop/pull/31764)
- [Removed deprecated controller AdminRequestSqlController](https://github.com/PrestaShop/PrestaShop/pull/31893)
- [Remove TranslationFinder and TranslationFinderTrait](https://github.com/PrestaShop/PrestaShop/pull/31991)
- [Remove TypeaheadRedirectionTargetTransformer and TranslateTextType](https://github.com/PrestaShop/PrestaShop/pull/31992)
- [Remove deprecated methods in LogRepository & RequestSqlRepository](https://github.com/PrestaShop/PrestaShop/pull/31993)
- [Remove triggered errors and deprecated for Grid](https://github.com/PrestaShop/PrestaShop/pull/31996)
- [Remove triggered error in GetProfileForEditingHandler](https://github.com/PrestaShop/PrestaShop/pull/31997)
- [Remove UpdateProductStatusCommand](https://github.com/PrestaShop/PrestaShop/pull/32157)
- [Remove old error message files](https://github.com/PrestaShop/PrestaShop/pull/32187)
- [Remove unused toolbar.tpl](https://github.com/PrestaShop/PrestaShop/pull/32190)
- [Remove deprecated classes for performances page](https://github.com/PrestaShop/PrestaShop/pull/32362)
- [Removed Order ActionBarButton](https://github.com/PrestaShop/PrestaShop/pull/32927)
- [Remove deprecated code from HttpKernel](https://github.com/PrestaShop/PrestaShop/pull/34778)
- [Clean horizontal migration code](https://github.com/PrestaShop/PrestaShop/pull/35191)
- Remove deprecated code in legacy classes:
- [Remove deprecated features on v9](https://github.com/PrestaShop/PrestaShop/pull/31028)
- [Remove Tools::encrypt and Tools::encryptIV](https://github.com/PrestaShop/PrestaShop/pull/31421)
- [Remove deprecated upload classes](https://github.com/PrestaShop/PrestaShop/pull/31705)
- [Removed deprecated parameter in class Cart](https://github.com/PrestaShop/PrestaShop/pull/31765)
- [Removed deprecated class linked to FileUpload](https://github.com/PrestaShop/PrestaShop/pull/31766)
- [Removed deprecated method Tools::isBright](https://github.com/PrestaShop/PrestaShop/pull/31769)
- [Removed deprecated method Tools::getBrightness](https://github.com/PrestaShop/PrestaShop/pull/32160)
- [Removed deprecated method Translate::getAdminTranslation](https://github.com/PrestaShop/PrestaShop/pull/31770)
- [Removed deprecated method addJquery in Controller class](https://github.com/PrestaShop/PrestaShop/pull/31889)
- [Removed deprecated method isAnything in class Validate](https://github.com/PrestaShop/PrestaShop/pull/31890)
- [Removed deprecated methods stripslashes & safePostVars in class Tools](https://github.com/PrestaShop/PrestaShop/pull/31891)
- [Removed deprecated methods generateDeliverySlipPDFByIdOrder & generateInvoicePDFByIdOrder in class AdminPdfController](https://github.com/PrestaShop/PrestaShop/pull/31892)
- [Removed deprecated parameters in OrderReturn](https://github.com/PrestaShop/PrestaShop/pull/32159)
- [Removed Tab::getClassName](https://github.com/PrestaShop/PrestaShop/pull/32161)
- [Removed SpecificPrice::setPriorities](https://github.com/PrestaShop/PrestaShop/pull/32163)
- [Removed Tools::displayNumber and Tools::displayPrice](https://github.com/PrestaShop/PrestaShop/pull/32164)
- [Removed deprecated displayFlags](https://github.com/PrestaShop/PrestaShop/pull/32189)
- [Removed unused functions getUrlRewriteInformation & getUrlRewriteInformations](https://github.com/PrestaShop/PrestaShop/pull/32232)
- [Removed Tools::clearColorListCache, Product::getColorsListCacheId, Validate::isPlaintextPassword, Validate::isPasswdAdmin, FrontController::addColorsToProductList](https://github.com/PrestaShop/PrestaShop/pull/32679)
- [Removed AdminController::isFresh, AdminController::refresh](https://github.com/PrestaShop/PrestaShop/pull/32693)
- [Removed Cart::simulateCarriersOutput](https://github.com/PrestaShop/PrestaShop/pull/33263)
- [Removed calls to Product::getProductProperties](https://github.com/PrestaShop/PrestaShop/pull/34498)
- [Move data from product::getProductProperties to ProductLazyArray](https://github.com/PrestaShop/PrestaShop/pull/34499)
- [Clean legacy Tab related code, and multiple other deprecations](https://github.com/PrestaShop/PrestaShop/pull/34525)
- [Remove unused Media methods](https://github.com/PrestaShop/PrestaShop/pull/34571)
- [Clean code in Module classes](https://github.com/PrestaShop/PrestaShop/pull/34731)
- [Removed unused legacy constants](https://github.com/PrestaShop/PrestaShop/pull/34927)
- [Removed ajaxDie and related hooks](https://github.com/PrestaShop/PrestaShop/pull/35283)
- [Removed deprecated object model validation code](https://github.com/PrestaShop/PrestaShop/pull/36029)

0 comments on commit 4e60f17

Please sign in to comment.