Skip to content

Latest commit

 

History

History
479 lines (416 loc) · 35.1 KB

UPGRADE-v9.1.0.md

File metadata and controls

479 lines (416 loc) · 35.1 KB

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.

Application

  • 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", to require-dev section in your composer.json file
  • 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)

  • make Frontend API tests more reliable (#1913)

  • update tests to use tests container to decrease amount of services defined in services_test.yaml (#1957)

  • apply fixers for compliance with PSR-12 (#1324)

    • run php phing standards-fix
  • 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 your yaml files
  • add phpstan-symfony extension (#1961) and (#1974)

  • 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
  • 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)

  • required new line at the end of each file (#1989)

  • 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
  • add articles resolver to your Frontend API (#1996)

  • move npm-global directory to project in order to make it included in Docker volumes (#2024)

  • 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)

  • 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
  • fix frontend-api tests when domain locales are changed (#2019)

  • 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() use getMainImagesByEntityIds() instead
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::$productActionViewFacade use Shopsys\ReadModelBundle\Product\Listed\ProductActionViewFactory instead
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::createFromProducts() use Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::createFromProducts() instead
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewElasticFacade::getIdsForProducts() use Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::getIdsForProducts() instead
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::$imageViewFacade
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::$productActionViewFacade
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::createFromProducts() use Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::createFromProducts() instead
      • Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFacade::getIdsForProducts() use Shopsys\ReadModelBundle\Product\Listed\ListedProductViewFactory::getIdsForProducts() instead
    • see project-base-diff to update your project
  • added more coding standards (#2035, #2052, #2173)

    • update your easy-coding-standard.yml with following change sets
    • 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
    • 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 with count($array)
  • 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)

  • add autocompletion for Phing targets (#2049)

  • made tests to be domain independent (#2051)

  • add additional data to Product frontend API type (#2057)

  • made parameters overridable by ENV variables (#2055)

  • 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)

  • 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
  • made frontend API tests to be currency independent (#2075)

  • add adverts in frontend API (#2068)

  • remove hirak/prestissimo from Dockerfile (#2089)

    • make sure you have composer 2 installed (composer --version)
    • see project-base-diff to update your project
  • fixed standards on new release of FriendsOfPHP/PHP-CS-Fixer (#2094)

    • run php phing standards-fix to apply fixes
  • 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
  • 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)

  • 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 set platform.php in composer.json to the required version
  • add support for customer user registration to your Frontend API (#2100)

  • add support for ordering products to your Frontend API (#2110)

  • ProductDetailView provided by elasticsearch (#2090)

    • add new fields to elasticsearch index definition for all domains
    • 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
    • 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
            ) {
  • fix cleaning of old redis cache (#2096)

  • enable logging in tests (#2113)

  • 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()
  • avoid missing or delayed logs (#2103)

  • disable javascript validation for product filter form (#2104)

  • 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
  • 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
            ) {
  • add support for subscribing for e-mail newsletter to FE API (#2119)

  • 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 major
    • TEST environment can now be used in CLI
    • DomainFactoryOverwritingDomainUrl is now replacing DomainFactory in ACCEPTANCE environment instead of TEST
  • add automatic string trimming and new Password type in frontend API (#2127)

  • 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 your Query.types.yaml file
    • 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
    • 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
            ) {
  • added total count to frontend API connections (#2141)

  • add ACCEPTANCE file to .gitignore (#2145)

  • add email length validation in SubscriptionFormType (#2120)

  • add support for finding entity by URL slug to FE API (#2150)

  • 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 in Shopsys\FrameworkBundle\Component\Router\FriendlyUrl\FriendlyUrlRouterFactory constructors argument named $mainFriendlyUrlSlugCache
    • 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
            ) {
  • 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 by getFilteredProductsCountOnCurrentDomain()
      • getProductsOnCurrentDomain() has been replaced by getFilteredProductsOnCurrentDomain()
      • getProductsByCategory() has been replaced by getFilteredProductsByCategory()
      • getProductsByCategoryCount() has been replaced by getFilteredProductsByCategoryCount()
      • getProductsByBrand() has been replaced by getFilteredProductsByBrand()
      • getProductsByBrandCount() has been replaced by getFilteredProductsByBrandCount()
    • 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)