This guide contains instructions to upgrade from version v9.0.4 to v9.1.0.
Before you start, don't forget to take a look at general instructions about upgrading. There you can find links to upgrade notes for other versions too.
-
add
psr/event-dispatcher
to your composer dependencies in order to prevent PHPStan errors in Event classes (#1894)- add
"psr/event-dispatcher": "^1.0.0",
torequire-dev
section in yourcomposer.json
file
- add
-
add support for changing personal data and password to your Frontend API (#1891)
- see project-base-diff to update your project
- following methods has changed their interface:
Shopsys\FrameworkBundle\Model\Customer\User\CustomerUserPasswordFacade::__construct()
public function __construct( EntityManagerInterface $em, CustomerUserRepository $customerUserRepository, EncoderFactoryInterface $encoderFactory, ResetPasswordMailFacade $resetPasswordMailFacade, - HashGenerator $hashGenerator + HashGenerator $hashGenerator, + ?CustomerUserRefreshTokenChainFacade $customerUserRefreshTokenChainFacade = null ) {
-
fix not working upload of files in wysiwyg editor (#1899)
- see project-base-diff to update your project
-
make Frontend API tests more reliable (#1913)
- see project-base-diff to update your project
-
update tests to use tests container to decrease amount of services defined in
services_test.yaml
(#1957)- see project-base-diff to update your project
-
apply fixers for compliance with PSR-12 (#1324)
- run
php phing standards-fix
- run
-
add new coding standards for YAML files (#1552)
- see project-base-diff and update your
yaml-standards.yaml
file - run
php phing standards-fix
to fix youryaml
files
- see project-base-diff and update your
-
add phpstan-symfony extension (#1961) and (#1974)
- see project-base-diff and project-base-diff to update your project
-
stop using Doctrine default value option (#1395)
- following properties no longer have a database default value, check if you set a default value in the constructor
Shopsys\FrameworkBundle\Component\Cron\CronModule::$suspended
Shopsys\FrameworkBundle\Component\Cron\CronModule::$enabled
Shopsys\FrameworkBundle\Model\Newsletter\NewsletterSubscriber::$createdAt
Shopsys\FrameworkBundle\Model\Product\Product::$recalculateAvailability
Shopsys\FrameworkBundle\Model\Product\Product::$recalculatePrice
Shopsys\FrameworkBundle\Model\Product\Product::$recalculateVisibility
- following properties no longer have a database default value, check if you set a default value in the constructor
-
introduced sniff for strict comparison (#1658)
- this change is temporary to help you prepare your project for next major version, where this will be required directly in coding-standards package
- see project-base-diff to update your project
-
moved setting of common entity data to new method (#1976)
- see project-base-diff to update your project
-
required new line at the end of each file (#1989)
- see project-base-diff
- to fix errors you may run
php phing standards-fix
-
phpstan analyse increased to level 5 (#1922)
- increasing phpstan level on your project is optional and may be set in
build.xml
- see project-base-diff to update your project
- BC BREAK method
FeedExportFactory::create
has changed definition of third argument (removed type hint)- in case you have overridden this method you have to make the interface compatible
- increasing phpstan level on your project is optional and may be set in
-
add articles resolver to your Frontend API (#1996)
- see project-base-diff to update your project
-
move npm-global directory to project in order to make it included in Docker volumes (#2024)
- see project-base-diff to update your project
-
update
docker/php-fpm/docker-php-entrypoint
to show all lines from first command output (#1827)mkfifo $PIPE chmod 666 $PIPE - tail -f $PIPE & + tail -n +1 -f $PIPE &
-
fix displaying '+' sign in product filter (#2023)
- see project-base-diff to update your project
-
remove setting domain locale in
CartFacadeTest
(#2037)- in tests is used extended class of
Shopsys\FrameworkBundle\Model\Localization\TranslatableListener
- removed
config/packages/test/prezent_doctrine_translatable.yaml
- see project-base-diff to update your project
- in tests is used extended class of
-
fix frontend-api tests when domain locales are changed (#2019)
- see project-base-diff to update your project
-
introduce read model layer into product detail (#1999)
- following methods has changed their interface:
Shopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::__construct()
public function __construct( ProductFacade $productFacade, ProductAccessoryFacade $productAccessoryFacade, Domain $domain, CurrentCustomerUser $currentCustomerUser, TopProductFacade $topProductFacade, ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade, ListedProductViewFactory $listedProductViewFactory, ProductActionViewFacade $productActionViewFacade, - ImageViewFacade $imageViewFacade + ImageViewFacadeInterface $imageViewFacade, + ?ProductActionViewFactory $productActionViewFactory = null ) {
Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::__construct()
public function __construct( Domain $domain, - ProductCachedAttributesFacade $productCachedAttributesFacade + ProductCachedAttributesFacade $productCachedAttributesFacade, + ?ImageViewFacadeInterface $imageViewFacade = null, + ?ProductActionViewFacadeInterface $productActionViewFacade = null ) {
- following methods and properties were deprecated and will be removed in the next major version:
Shopsys\ReadModelBundle\Image\ImageViewFacade::getForEntityIds()
usegetMainImagesByEntityIds()
insteadShopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::$productActionViewFacade
useShopsys\ReadModelBundle\Product\Listed\ProductActionViewFactory
insteadShopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::createFromProducts()
useShopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::createFromProducts()
insteadShopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::getIdsForProducts()
useShopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::getIdsForProducts()
insteadShopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::$imageViewFacade
Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::$productActionViewFacade
Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::createFromProducts()
useShopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::createFromProducts()
insteadShopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::getIdsForProducts()
useShopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::getIdsForProducts()
instead
- see project-base-diff to update your project
- following methods has changed their interface:
-
added more coding standards (#2035, #2052, #2173)
- update your
easy-coding-standard.yml
with following change sets- see project-base-diff of changes in
easy-coding-standard.yml
- see project-base-diff of changes in
easy-coding-standard.yml
- see project-base-diff of changes in
easy-coding-standard.yml
- see project-base-diff of changes in
- the most of the rules have their own fixer, run
php phing ecs-fix
to resolve them- you need to run
ecs-fix
multiple times until it is OK, because of the amount of changes
- you need to run
- disallowed usage of
empty()
is one which must be fixed manually- first of all, you should keep in mind the
empty
ignores undefined offsets and is typed weak - this state should be probably kept - when your part of code has not been strictly typed yet, you should resolve it first otherwise you will be hacking a new
empty
function by yourself and this rule will have no benefit for you - if
empty
is used for checking elements of an array it can be replaced withcount($array)
- first of all, you should keep in mind the
- update your
-
remove unnecessary default values for ENV variables (#2040)
- these parameters should be configured via ENV variables if set
- see project-base-diff to update your project
-
add brands in frontend API (#2047)
- see project-base-diff to update your project
-
add autocompletion for Phing targets (#2049)
- see project-base-diff to update your project
-
made tests to be domain independent (#2051)
- see project-base-diff to update your project
-
add additional data to Product frontend API type (#2057)
- see project-base-diff to update your project
-
made parameters overridable by ENV variables (#2055)
- how to configure your application with ENV variables can be found in our docs
- see project-base-diff to update your project
-
added Product SEO information to elasticsearch (#2074)
- see project-base-diff to update your project
- run
php phing elasticsearch-index-migrate elasticsearch-export
to apply changes
-
added SEO information to frontend API (#2067, #2112)
- see project-base-diff and project-base-diff to update your project
-
add promoted products in frontend API (#2066)
- translation in the administration was changed from "Main page products" to "Promoted products"
- translation ID will be changed accordingly in the next major
- see project-base-diff to update your project
- translation in the administration was changed from "Main page products" to "Promoted products"
-
made frontend API tests to be currency independent (#2075)
- see project-base-diff to update your project
-
add adverts in frontend API (#2068)
- see project-base-diff to update your project
-
remove hirak/prestissimo from Dockerfile (#2089)
- make sure you have composer 2 installed (
composer --version
) - see project-base-diff to update your project
- make sure you have composer 2 installed (
-
fixed standards on new release of FriendsOfPHP/PHP-CS-Fixer (#2094)
- run
php phing standards-fix
to apply fixes
- run
-
load javascripts after content is loaded (#1879)
- if you set the parameter
fp_js_form_validator.twig_extension.class
to a custom class, please adjust this class according to #1879 - see project-base-diff to update your project
- if you set the parameter
-
allow placing scripts in administration after content(#2086)
- see project-base-diff to update your project
- following methods has changed their interface:
\Shopsys\FrameworkBundle\Form\Admin\Script\ScriptFormType::__construct()
+ public function __construct(ScriptFacade $scriptFacade) + { + $this->scriptFacade = $scriptFacade; + }
- following class was deprecated and will be removed in the next major
-
Shopsys\FrameworkBundle\Form\Transformers\ScriptPlacementToBooleanTransformer
- following method was deprecated and will be removed in the next major
-
Shopsys\FrameworkBundle\Model\Script\ScriptFacade::getAllPagesScriptCodes()
-
increase reliability and decrease maintainability of acceptance tests (#2099)
- see project-base-diff to update your project
-
drop support for lower PHP versions than 7.4.1 (#2109)
- see project-base-diff to update your project
- update your dependencies with
composer update
after you setplatform.php
incomposer.json
to the required version
-
add support for customer user registration to your Frontend API (#2100)
- see project-base-diff to update your project
-
add support for ordering products to your Frontend API (#2110)
- see project-base-diff to update your project
-
ProductDetailView provided by elasticsearch (#2090)
- add new fields to elasticsearch index definition for all domains
- see project-base-diff to update your project
- run
php phing elasticsearch-index-migrate elasticsearch-export
to apply changes- with products there are exported variants too now
- it should not cause any trouble as filtering product from Elasticsearch was edited to filter variants out, so it behaves same as earlier
- when you have some of related functionality extended you should probably want to filter variants out by yourself
- method
FilterQuery::filterOutVariants()
was introduced for this purposes
- method
- with products there are exported variants too now
- following methods has changed their interface:
Shopsys\FrameworkBundle\Model\Product\Elasticsearch\ProductExportRepository::__construct()
public function __construct( EntityManagerInterface $em, ParameterRepository $parameterRepository, ProductFacade $productFacade, FriendlyUrlRepository $friendlyUrlRepository, Domain $domain, ProductVisibilityRepository $productVisibilityRepository, - FriendlyUrlFacade $friendlyUrlFacade + FriendlyUrlFacade $friendlyUrlFacade, + ?CategoryFacade $categoryFacade = null, + ?ProductAccessoryFacade $productAccessoryFacade = null, + ?BrandCachedFacade $brandCachedFacade = null ) {
Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::__construct()
public function __construct( Domain $domain, ProductCachedAttributesFacade $productCachedAttributesFacade, ?ImageViewFacadeInterface $imageViewFacade = null, - ?ProductActionViewFacadeInterface $productActionViewFacade = null + ?ProductActionViewFacadeInterface $productActionViewFacade = null, + ?ProductActionViewFactory $productActionViewFactory = null, + ?CurrentCustomerUser $currentCustomerUser = null, + ?PriceFactory $priceFactory = null ) {
- add new fields to elasticsearch index definition for all domains
-
fix cleaning of old redis cache (#2096)
- see project-base-diff to update your project
-
enable logging in tests (#2113)
- see project-base-diff to update your project
-
replace private to protected for constraints (#2070)
- visibility of following properties and methods is now protected instead of private. You should adjust visibility in extended classes
Shopsys\FrameworkBundle\Form\Constraints\CountryValidator::$domain
Shopsys\FrameworkBundle\Form\Constraints\EmailValidator::isEmail()
Shopsys\FrameworkBundle\Form\Constraints\FileAbstractFilesystemValidator::$mountManager
Shopsys\FrameworkBundle\Form\Constraints\FileAbstractFilesystemValidator::$fileUpload
Shopsys\FrameworkBundle\Form\Constraints\FileAbstractFilesystemValidator::$parameterBag
Shopsys\FrameworkBundle\Form\Constraints\ImageAbstractFilesystemValidator::$mountManager
Shopsys\FrameworkBundle\Form\Constraints\ImageAbstractFilesystemValidator::$fileUpload
Shopsys\FrameworkBundle\Form\Constraints\ImageAbstractFilesystemValidator::$parameterBag
Shopsys\FrameworkBundle\Form\Constraints\NotSelectedDomainToShowValidator::$domain
Shopsys\FrameworkBundle\Form\Constraints\UniqueCollectionValidator::areValuesEqual()
Shopsys\FrameworkBundle\Form\Constraints\UniqueCollectionValidator::areValuesEqualInFields()
Shopsys\FrameworkBundle\Form\Constraints\UniqueCollectionValidator::getFieldValue()
Shopsys\FrameworkBundle\Form\Constraints\UniqueEmailValidator::$customerUserFacade
Shopsys\FrameworkBundle\Form\Constraints\UniqueEmailValidator::$domain
Shopsys\FrameworkBundle\Form\Constraints\UniqueSlugsOnDomainsValidator::$domain
Shopsys\FrameworkBundle\Form\Constraints\UniqueSlugsOnDomainsValidator::$domainRouterFactory
Shopsys\FrameworkBundle\Form\Constraints\UniqueSlugsOnDomainsValidator::validateDuplication()
Shopsys\FrameworkBundle\Form\Constraints\UniqueSlugsOnDomainsValidator::validateExists()
Shopsys\FrameworkBundle\Form\Constraints\UniqueSlugsOnDomainsValidator::getSlugsCountIndexedByDomainId()
- visibility of following properties and methods is now protected instead of private. You should adjust visibility in extended classes
-
avoid missing or delayed logs (#2103)
- see project-base-diff to update your project
-
disable javascript validation for product filter form (#2104)
- see project-base-diff to update your project
-
move doctrine metadata and annotations cache to file instead of redis (#2107)
- class
Shopsys\FrameworkBundle\Component\Doctrine\Cache\FallbackCacheFactory
is deprecated and will be removed in next major version- in case you need it in your project you should implement it by yourself
- see project-base-diff to update your project
- class
-
accessories is provided by elasticsearch for ListedProductView (#2123)
- following methods has changed their interface:
Shopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::__construct()
public function __construct( ProductFacade $productFacade, ProductAccessoryFacade $productAccessoryFacade, Domain $domain, CurrentCustomerUser $currentCustomerUser, TopProductFacade $topProductFacade, ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade, ListedProductViewFactory $listedProductViewFactory, ProductActionViewFacade $productActionViewFacade, ImageViewFacadeInterface $imageViewFacade, - ?ProductActionViewFactory $productActionViewFactory = null + ?ProductActionViewFactory $productActionViewFactory = null, + ?ProductElasticsearchProvider $productElasticsearchProvider = null ) {
- following methods has changed their interface:
-
add support for subscribing for e-mail newsletter to FE API (#2119)
- see project-base-diff to update your project
-
apply environment changes in your application (#2117)
- see project-base-diff to update your project
EnvironmentFileSetting::getEnvironment()
has now its$console
parameter nullable and will be fully removed in next majorTEST
environment can now be used in CLIDomainFactoryOverwritingDomainUrl
is now replacingDomainFactory
inACCEPTANCE
environment instead ofTEST
-
add automatic string trimming and new Password type in frontend API (#2127)
- see project-base-diff to update your project
-
change source of data for a single product to Elasticsearch in FE API (#2131)
- see project-base-diff to update your project
- run
php phing elasticsearch-index-migrate elasticsearch-export
to apply changes in Elasticsearch schema mapping - BC BREAK single product by UUID is now loaded from Elasticsearch with
productDetail
resolver- if necessary, you can switch to the former resolver
product
in yourQuery.types.yaml
file
- if necessary, you can switch to the former resolver
- following methods has changed their interface:
Shopsys\FrontendApiBundle\Model\Resolver\Price\PriceResolver::__construct()
public function __construct( ProductCachedAttributesFacade $productCachedAttributesFacade, ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade, PaymentPriceCalculation $paymentPriceCalculation, Domain $domain, CurrencyFacade $currencyFacade, - TransportPriceCalculation $transportPriceCalculation + TransportPriceCalculation $transportPriceCalculation, + ?PriceFacade $priceFacade = null ) {
- following class was deprecated and will be removed in the next major
Shopsys\FrontendApiBundle\Model\Resolver\Products\ProductResolver
-
provide cache directory to DomainRouterFactory and LocalizedRouterFactory (#2133)
- the step is necessary in case you have extended following classes:
Shopsys\FrameworkBundle\Component\Router\DomainRouterFactory
Shopsys\FrameworkBundle\Component\Router\LocalizedRouterFactory
- pass cache directory argument in your
services.yaml
as$cacheDir
- for this purpose there were introduced 2 new parameters to be used:
shopsys.router.domain.cache_dir
shopsys.router.localized.cache_dir
- for this purpose there were introduced 2 new parameters to be used:
- following methods has changed their interface:
Shopsys\FrameworkBundle\Component\Router\DomainRouterFactory::__construct()
public function __construct( $routerConfiguration, - LoaderInterface $configLoader, + ?LoaderInterface $configLoader, LocalizedRouterFactory $localizedRouterFactory, FriendlyUrlRouterFactory $friendlyUrlRouterFactory, Domain $domain, - RequestStack $requestStack + RequestStack $requestStack, + ?ContainerInterface $container = null, + ?string $cacheDir = null ) {
Shopsys\FrameworkBundle\Component\Router\LocalizedRouterFactory::__construct()
public function __construct( $localeRoutersResourcesFilepathMask, - LoaderInterface $configLoader, + ?LoaderInterface $configLoader = null, + ?ContainerInterface $container = null, + ?string $cacheDir = null ) {
- the step is necessary in case you have extended following classes:
-
added total count to frontend API connections (#2141)
- see project-base-diff to update your project
-
add ACCEPTANCE file to .gitignore (#2145)
- see project-base-diff to update your project
-
add email length validation in SubscriptionFormType (#2120)
- see project-base-diff to update your project
-
add support for finding entity by URL slug to FE API (#2150)
- see project-base-diff to update your project
-
use DBAL native queries for DML instead of ORM Native SQL (#2148)
- you may want to update your own native queries in similar way
- don't forget that parameters in the
executeStatement()
call should have a type explicitly defined (see PR for examples) - see project-base-diff to update your project
- following class was deprecated and will be removed in the next major
Shopsys\FrameworkBundle\Component\DataFixture\AbstractNativeFixture
-
set redis client to cache friendly url slugs (#2146)
- see project-base-diff to update your project
- you need to define new cache pool
main_friendly_url_slug_cache
which will be automatically passed inShopsys\FrameworkBundle\Component\Router\FriendlyUrl\FriendlyUrlRouterFactory
constructors argument named$mainFriendlyUrlSlugCache
- you need to define new cache pool
- following methods has changed their interface:
Shopsys\FrameworkBundle\Component\Router\FriendlyUrl\FriendlyUrlFacade::__construct()
public function __construct( EntityManagerInterface $em, DomainRouterFactory $domainRouterFactory, FriendlyUrlUniqueResultFactory $friendlyUrlUniqueResultFactory, FriendlyUrlRepository $friendlyUrlRepository, Domain $domain, - FriendlyUrlFactoryInterface $friendlyUrlFactory + FriendlyUrlFactoryInterface $friendlyUrlFactory, + ?FriendlyUrlCacheKeyProvider $friendlyUrlCacheKeyProvider = null, + ?CacheInterface $mainFriendlyUrlSlugCache = null ) {
Shopsys\FrameworkBundle\Component\Router\FriendlyUrl\FriendlyUrlGenerator::__construct()
public function __construct( RequestContext $context, - FriendlyUrlRepository $friendlyUrlRepository + FriendlyUrlRepository $friendlyUrlRepository, + ?FriendlyUrlCacheKeyProvider $friendlyUrlCacheKeyProvider = null, + ?CacheInterface $mainFriendlyUrlSlugCache = null ) {
Shopsys\FrameworkBundle\Component\Router\FriendlyUrl\FriendlyUrlRouterFactory::__construct()
public function __construct( $friendlyUrlRouterResourceFilepath, LoaderInterface $configLoader, - FriendlyUrlRepository $friendlyUrlRepository + FriendlyUrlRepository $friendlyUrlRepository, + ?FriendlyUrlCacheKeyProvider $friendlyUrlCacheKeyProvider = null, + ?CacheInterface $mainFriendlyUrlSlugCache = null ) {
- see project-base-diff to update your project
-
add products filtering to FE API (#2156)
- see project-base-diff to update your project
- these methods in
Shopsys\FrontendApiBundle\Model\Product\ProductFacade
are now deprecated:getProductsCountOnCurrentDomain()
has been replaced bygetFilteredProductsCountOnCurrentDomain()
getProductsOnCurrentDomain()
has been replaced bygetFilteredProductsOnCurrentDomain()
getProductsByCategory()
has been replaced bygetFilteredProductsByCategory()
getProductsByCategoryCount()
has been replaced bygetFilteredProductsByCategoryCount()
getProductsByBrand()
has been replaced bygetFilteredProductsByBrand()
getProductsByBrandCount()
has been replaced bygetFilteredProductsByBrandCount()
- following methods has changed their interface:
\Shopsys\FrontendApiBundle\Model\Resolver\Products\ProductsResolver::__construct()
public function __construct( ProductOnCurrentDomainFacadeInterface $productOnCurrentDomainFacade, - ?ProductFacade $productFacade = null + ?ProductFacade $productFacade = null, + ?ProductFilterFacade $productFilterFacade = null, + ?ProductConnectionFactory $productConnectionFactory = null ) {
-
add search of products and categories to FE API (#2163)
- see project-base-diff to update your project