35 KiB
UPGRADE FROM v1.12.X TO v1.13.0
Preconditions
PHP 8.1 support
Sylius 1.13 comes with a bump of minimum PHP version to 8.1. We strongly advice to make upgrade process step by step, so it is highly recommended updating your PHP version being still on Sylius 1.12. After ensuring, that previous step succeed, you may move forward to the Sylius 1.13 update.
Symfony support
In Sylius 1.13, the minimum supported version of Symfony 6 has been bumped up to 6.4. Sylius 1.13 supports both long-term supported Symfony versions: 5.4 and 6.4.
Main update
-
Starting with Sylius
1.13we provided a possibility to use the Symfony Workflow as your State Machine. To allow a smooth transition we created a new package calledsylius/state-machine-abstraction, which provides a configurable abstraction, allowing you to define which adapter should be used (Winzou State Machine or Symfony Workflow) per graph. Starting with Sylius1.13we configure all existing Sylius' graphs to use the Symfony Workflow. At the same time, all other graphs are using Winzou State Machine as a default state machine, and must be configured manually to use the Symfony Workflow.Configuration:
sylius_state_machine_abstraction: graphs_to_adapters_mapping: <graph_name>: <adapter_name> # e.g. sylius_order_checkout: symfony_workflow # available adapters: symfony_workflow, winzou_state_machine # we can also can the default adapter default_adapter: symfony_workflow # winzou_state_machine is a default value hereNote! Starting with Sylius
2.0the Symfony Workflow will be the default state machine for all graphs. -
A new parameter has been added to specify the validation groups for given gateway factory. If you have any custom validation groups for your factory, you need to add them to your
config/packages/_sylius.yamlfile. Also, if you have your own gateway factory and want to add your validation groups you can add another entry to thevalidation_groupsconfiguration node. It is handled byGatewayConfigGroupsGeneratorand it resolves the groups based on the passed factory name.sylius_payum: gateway_config: validation_groups: paypal_express_checkout: - 'sylius' - 'sylius_paypal_express_checkout' stripe_checkout: - 'sylius' - 'sylius_stripe_checkout' your_gateway: - 'sylius' - 'your_custom_validation_group' -
There have been a naw parameters added to specify the validation groups for given shipping method rule and calculator. If you have any custom validation groups for your calculator or rules, you need to add them to your
config/packages/_sylius.yamlfile. Also, if you have your own shipping method rule or calculator and want to add your validation groups you can add another key to thevalidation_groupsparameter.sylius_shipping: shipping_method_rule: validation_groups: total_weight_greater_than_or_equal: - 'sylius' - 'sylius_shipping_method_rule_total_weight' order_total_greater_than_or_equal: - 'sylius' - 'sylius_shipping_method_rule_order_total' your_shipping_method_rule: - 'sylius' - 'your_custom_validation_group' shipping_method_calculator: validation_groups: flat_rate: - 'sylius' - 'sylius_shipping_method_calculator_rate' per_unit_rate: - 'sylius' - 'sylius_shipping_method_calculator_rate' your_shipping_method_calculator: - 'sylius' - 'your_custom_validation_group' -
Class
Sylius\Component\Core\Promotion\Updater\Rule\TotalOfItemsFromTaxonRuleUpdaterhas been deprecated, as it is no more used. -
Class
Sylius\Component\Core\Promotion\Updater\Rule\ContainsProductRuleUpdaterhas been deprecated, as it is no more used. -
Class
Sylius\Bundle\AdminBundle\EmailManager\OrderEmailManagerand its interfaceSylius\Bundle\AdminBundle\EmailManager\OrderEmailManagerInterfacehave been deprecated, useSylius\Bundle\CoreBundle\Mailer\OrderEmailManagerandSylius\Bundle\CoreBundle\Mailer\OrderEmailManagerInterfaceinstead. -
Class
Sylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManagerand its interfaceSylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManagerInterfacehave been deprecated, useSylius\Bundle\CoreBundle\Mailer\ShipmentEmailManagerandSylius\Bundle\CoreBundle\Mailer\ShipmentEmailManagerInterfaceinstead. -
Class
Sylius\Bundle\ShopBundle\EmailManager\ContactEmailManagerand its interfaceSylius\Bundle\ShopBundle\EmailManager\ContactEmailManagerInterfacehave been deprecated, useSylius\Bundle\CoreBundle\Mailer\ContactEmailManagerandSylius\Bundle\CoreBundle\Mailer\ContactEmailManagerInterfaceinstead. -
Class
Sylius\Bundle\ShopBundle\EmailManager\OrderEmailManagerand its interfaceSylius\Bundle\ShopBundle\EmailManager\OrderEmailManagerInterfacehave been deprecated, useSylius\Bundle\CoreBundle\Mailer\OrderEmailManagerandSylius\Bundle\CoreBundle\Mailer\OrderEmailManagerInterfaceinstead. -
Class
Sylius\Bundle\ProductBundle\Form\Type\ProductOptionChoiceTypehas been deprecated. UseSylius\Bundle\ProductBundle\Form\Type\ProductOptionAutocompleteTypeinstead. -
Using
parentIdquery parameter to generate slug inSylius\Bundle\TaxonomyBundle\Controller\TaxonSlugControllerhas been deprecated. Use theparentCodequery parameter instead. -
Starting with Sylius 1.13, the
SyliusPriceHistoryPluginis included. If you are currently using the plugin in your project, we recommend following the upgrade guide located here. -
The
Sylius\Bundle\CoreBundle\CatalogPromotion\Command\RemoveInactiveCatalogPromotioncommand and its handlerSylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\RemoveInactiveCatalogPromotionHandlerhave been deprecated. UseSylius\Bundle\CoreBundle\CatalogPromotion\Command\RemoveCatalogPromotioncommand instead. -
Passing
Symfony\Component\Messenger\MessageBusInterfacetoSylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionRemovalProcessoras a second and third argument is deprecated. -
Passing
Sylius\Bundle\AdminBundle\EmailManager\OrderEmailManagerInterfacetoSylius\Bundle\AdminBundle\Action\ResendOrderConfirmationEmailActionas a second argument is deprecated, useSylius\Bundle\CoreBundle\MessageDispatcher\ResendOrderConfirmationEmailDispatcherInterfaceinstead. -
The name of the second argument of
Sylius\Bundle\AdminBundle\Action\ResendOrderConfirmationEmailActionis deprecated and will be renamed to$resendOrderConfirmationEmailDispatcher. -
Passing
Sylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManagerInterfacetoSylius\Bundle\AdminBundle\Action\ResendShipmentConfirmationEmailActionas a second argument is deprecated, useSylius\Bundle\CoreBundle\MessageDispatcher\ResendShipmentConfirmationEmailDispatcherInterfaceinstead. -
The name of the second argument of
Sylius\Bundle\AdminBundle\Action\ResendShipmentConfirmationEmailActionis deprecated and will be renamed to$resendShipmentConfirmationEmailDispatcher. -
Passing
Sylius\Bundle\AdminBundle\EmailManager\ShipmentEmailManagerInterfacetoSylius\Bundle\AdminBundle\EventListener\ShipmentShipListeneras a first argument is deprecated, useSylius\Bundle\CoreBundle\Mailer\ShipmentEmailManagerInterfaceinstead. -
Passing
Sylius\Bundle\ShopBundle\EmailManager\OrderEmailManagerInterfacetoSylius\Bundle\ShopBundle\EventListener\OrderCompleteListeneras a first argument is deprecated, useSylius\Bundle\CoreBundle\Mailer\OrderEmailManagerInterfaceinstead. -
Passing
Sylius\Bundle\ShopBundle\EmailManager\ContactEmailManagerInterfacetoSylius\Bundle\ShopBundle\Controller\ContactControlleras last argument is deprecated, useSylius\Bundle\CoreBundle\Mailer\ContactEmailManagerInterfaceinstead. -
Not passing
Sylius\Bundle\CoreBundle\CatalogPromotion\Announcer\CatalogPromotionRemovalAnnouncerInterfacetoSylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionRemovalProcessoras a second argument is deprecated. -
Not passing
Doctrine\Persistence\ObjectManagertoSylius\Component\Core\Updater\UnpaidOrdersStateUpdateras a fifth argument is deprecated. -
Not passing
Symfony\Component\Filesystem\Filesystemas fourth argument and parameters file path as fifth toSylius\Bundle\CoreBundle\Installer\Setup\LocaleSetupis deprecated and will be prohibited in Sylius 2.0. -
To ease customization we've introduced attributes for some services in
1.13:Sylius\Bundle\OrderBundle\Attribute\AsCartContextfor cart contextsSylius\Bundle\OrderBundle\Attribute\AsOrderProcessorfor order processorsSylius\Bundle\ProductBundle\Attribute\AsProductVariantResolverfor product variant resolvers
By default, Sylius still configures them using interfaces, but this way you cannot define a priority. If you want to define a priority, you need to set the following configuration in your
_sylius.yamlfile:sylius_core: autoconfigure_with_attributes: trueand use one of the new attributes accordingly to the type of your class, e.g.:
<?php declare(strict_types=1); namespace App\OrderProcessor; use Sylius\Bundle\OrderBundle\Attribute\AsOrderProcessor; use Sylius\Component\Order\Model\OrderInterface; use Sylius\Component\Order\Processor\OrderProcessorInterface; #[AsOrderProcessor(/*priority: 10*/)] //priority is optional final class OrderProcessorWithAttributeStub implements OrderProcessorInterface { public function process(OrderInterface $order): void { } } -
Not passing
Sylius\Component\Core\Checker\ProductVariantLowestPriceDisplayCheckerInterfacetoSylius\Component\Core\Calculator\ProductVariantPriceCalculatoras a first argument is deprecated. -
Not passing an instance of
Symfony\Component\PropertyAccess\PropertyAccessorInterfacetoSylius\Bundle\CoreBundle\Validator\Constraints\HasEnabledEntityValidatoras the second argument is deprecated. -
Not passing an instance of
Sylius\Component\Core\Payment\Remover\OrderPaymentsRemoverInterfaceand a collection of unprocessable order states toSylius\Component\Core\OrderProcessing\OrderPaymentProcessoras the third and fourth arguments respectively is deprecated. -
Not passing an instance of
Sylius\Component\Core\Distributor\ProportionalIntegerDistributorInterfacetoSylius\Component\Core\Taxation\Applicator\OrderItemsTaxesApplicatorand toSylius\Component\Core\Taxation\Applicator\OrderItemUnitsTaxesApplicatoras the last argument is deprecated. -
Class
\Sylius\Bundle\ShopBundle\Calculator\OrderItemsSubtotalCalculatorhas been deprecated. Order items subtotal calculation is now available on the Order model\Sylius\Component\Core\Model\Order::getItemsSubtotal. -
The way of getting variants prices based on options has been changed, as such the following services were deprecated, please use their new counterpart.
- instead of
Sylius\Component\Core\Provider\ProductVariantsPricesProviderInterfaceuseSylius\Component\Core\Provider\ProductVariantMap\ProductVariantsMapProviderInterface - instead of
Sylius\Component\Core\Provider\ProductVariantsPricesProvideruseSylius\Component\Core\Provider\ProductVariantMap\ProductVariantsPricesMapProvider - instead of
Sylius\Bundle\CoreBundle\Templating\Helper\ProductVariantsPricesHelperuseSylius\Component\Core\Provider\ProductVariantMap\ProductVariantsPricesMapProvider - instead of
Sylius\Bundle\CoreBundle\Twig\ProductVariantsPricesExtensionuseSylius\Bundle\CoreBundle\Twig\ProductVariantsMapExtension
Subsequently, the
sylius_product_variant_pricestwig function is deprecated, usesylius_product_variants_mapinstead.To add more data per variant create a service implementing the
Sylius\Component\Core\Provider\ProductVariantMap\ProductVariantMapProviderInterfaceand tag it withsylius.product_variant_data_map_provider. - instead of
-
Using Guzzle 6 has been deprecated in favor of Symfony HTTP Client. If you want to still use Guzzle 6 or Guzzle 7, you need to install
composer require php-http/guzzle6-adapterorcomposer require php-http/guzzle7-adapterdepending on your Guzzle version. Subsequently, you need to register the adapter as aPsr\Http\Client\ClientInterfaceservice as the following:services: Psr\Http\Client\ClientInterface: class: Http\Adapter\Guzzle7\Client # for Guzzle 6 use Http\Adapter\Guzzle6\Client instead -
The constructor of
Sylius\Bundle\AdminBundle\Controller\NotificationControllerhas been changed:public function __construct( - private ClientInterface $client, - private MessageFactory $messageFactory, + private ClientInterface|DeprecatedClientInterface $client, + private RequestFactoryInterface|MessageFactory $requestFactory, private string $hubUri, private string $environment, + private ?StreamFactoryInterface $streamFactory = null, ) { ... } -
The
sylius.http_message_factoryservice has been deprecated. UsePsr\Http\Message\RequestFactoryInterfaceinstead. -
The
sylius.http_clienthas become an alias topsr18.http_clientservice. -
The
sylius.payum.http_clienthas become a service ID of newly createdSylius\Bundle\PayumBundle\HttpClient\HttpClient. -
Validation translation key
sylius.review.rating.rangehas been replaced bysylius.review.rating.not_in_rangein all places used by Sylius. Thesylius.review.rating.rangehas been left for backward compatibility and will be removed in Sylius 2.0. -
The
payum/payumpackage has been replaced by concrete packages likepayum/core,payum/offlineorpayum/paypal-express-checkout-nvp. If you need any other component so far provided bypayum/payumpackage, you need to install it explicitly. -
PostgreSQL migration support has been introduced. If you are using PostgreSQL, we assume that you have already created a database schema in some way. All you need to do is run migrations, which will mark all migrations created before Sylius 1.13 as executed.
-
Not passing an
$entityManagerand passing a$doctrineRegistrytoSylius\Bundle\CoreBundle\Installer\Provider\DatabaseSetupCommandsProviderconstructor is deprecated and will be prohibited in Sylius 2.0. -
Product variants resolving has been refactored for better extendability. The tag
sylius.product_variant_resolver.defaulthas been removed as it was never used.All internal usages of service
sylius.product_variant_resolver.defaulthave been switched toSylius\Component\Product\Resolver\ProductVariantResolverInterface, if you have been using thesylius.product_variant_resolver.defaultservice apply this change accordingly. -
Due to optimizations of the Order's grid the
Sylius\Component\Core\Repository\OrderRepositoryInterface::createSearchListQueryBuildermethod bas been deprecated in both the interface and the class, and replaced bySylius\Component\Core\Repository\OrderRepositoryInterface::createCriteriaAwareSearchListQueryBuilder. AlsoSylius\Component\Core\Repository\OrderRepositoryInterface::createByCustomerIdQueryBuilderhas been deprecated in both the interface and the class, and replaced bySylius\Component\Core\Repository\OrderRepositoryInterface::createByCustomerIdCriteriaAwareQueryBuilderfor the same reason. Both changes affectsylius_admin_orderandsylius_admin_customer_ordergrids configuration. -
We have explicitly added relationships between product and reviews and between product and attributes in XML mappings. Because of that, the subscribers
Sylius\Bundle\AttributeBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriberandSylius\Bundle\ReviewBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriberhave changed so that it does not add a relationship if one already exists. If you have overwritten or decorated it, there may be a need to update it. -
Passing an instance of
Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterfaceas the first argument toSylius\Bundle\AttributeBundle\Form\Type\AttributeType\Configuration\SelectAttributeChoicesCollectionTypehas been deprecated. -
The
sylius_admin_ajax_taxon_moveroute has been deprecated. If you're relaying on it, consider migrating to newsylius_admin_ajax_taxon_move_upandsylius_admin_ajax_taxon_move_downroutes. -
Not passing a
$fileLocatortoSylius\Bundle\CoreBundle\Fixture\Factory\ProductExampleFactoryconstructor is deprecated and will be prohibited in Sylius 2.0. -
Interface
Sylius\Bundle\ShopBundle\Calculator\OrderItemsSubtotalCalculatorInterfaceand classSylius\Bundle\ShopBundle\Twig\OrderItemsSubtotalExtensionresponsible for thesylius_order_items_subtotaltwig function have been deprecated and will be removed in Sylius 2.0. Use the::getItemsSubtotal()method from theOrderclass instead. -
The
Sylius\Bundle\CoreBundle\Fixture\Factory\PaymentFixturehas been deprecated. UseSylius\Bundle\CoreBundle\Fixture\PaymentFixtureinstead. -
Not passing a
$routertoSylius\Bundle\AdminBundle\Controller\ImpersonateUserControlleras the fourth argument is deprecated and will be prohibited in Sylius 2.0. -
The
Sylius\Bundle\CoreBundle\Provider\SessionProviderhas been deprecated and will be removed in Sylius 2.0. -
Interface
Sylius\Component\Core\Promotion\Updater\Rule\ProductAwareRuleUpdaterInterfacehas been deprecated and will be removed in Sylius 2.0. -
Both
getCreatedByGuestandsetCreatedByGuestmethods were deprecated on\Sylius\Component\Core\Model\OrderInterface. Please useisCreatedByGuestinstead of the first one. The latter is a part of thesetCustomerWithAuthorizationlogic and should be used only this way. -
The
Sylius\Bundle\ShippingBundle\Provider\CalendarandSylius\Bundle\ShippingBundle\Provider\DateTimeProviderhave been deprecated and will be removed in Sylius 2.0. UseSymfony\Component\Clock\Clockinstead. Note: this class is available since Symfony 6.2. -
In the
sylius_paymentstate machine ofPaymentBundle, there has been a change in the state name:- State name change:
- From:
void - To:
unknown
- From:
- State name change:
-
In the
sylius_paymentstate machine ofPaymentBundle, a new stateauthorizedhas been introduced, along with a new transition:- Transition
authorize:- From states: [
new,processing] - To state:
authorized
- From states: [
Due to that the following transitions have been updated:
- Transition
complete:- From states: [
new,processing,authorized] - To state:
completed
- From states: [
- Transition
fail:- From states: [
new,processing,authorized] - To state:
failed
- From states: [
- Transition
cancel:- From states: [
new,processing,authorized] - To state:
cancelled
- From states: [
- Transition
void:- From states: [
new,processing,authorized] - To state:
unknown
- From states: [
- Transition
-
The
sylius_paymentstate machine ofCoreBundlehas been updated to allow failing an authorized payment:fail: - from: [new, processing] + from: [new, processing, authorized] to: failed -
Change in the
Sylius\Bundle\CoreBundle\Fixture\Factory\PromotionExampleFactoryconstructor: Added the$localeRepositoryargument to the constructor of thePromotionExampleFactoryclass. Not passing an instance ofRepositoryInterfacefor thelocaleentity repository in$localeRepositorywas marked as deprecated and will be prohibited in Sylius 2.0. -
The
Regexconstraint has been removed fromSylius\Component\Addressing\Model\Countryin favour of theCountryconstraint. Due to that, it's translation messagesylius.country.code.regexwas also removed. -
The
redirectToCartSummaryprotected method ofSylius\Bundle\OrderBundle\Controller\OrderControllerhas been deprecated as it was never used and will be removed in Sylius 2.0. -
Interface
Sylius\Component\Promotion\Generator\PromotionCouponGeneratorInstructionInterfacehas been refactored and is now deprecated. It now extends a new interfaceSylius\Component\Promotion\Generator\PromotionCouponGeneratorInstructionReadInterface, which contains only getter methods.- If your services or custom implementations previously relied on
PromotionCouponGeneratorInstructionInterfacefor read operations, you should now usePromotionCouponGeneratorInstructionReadInterfacefor better clarity and separation of concerns. - This change is backward compatible as long as your implementations or services were using only the getter methods from
PromotionCouponGeneratorInstructionInterface. However, if you also utilized setter methods, you should continue usingPromotionCouponGeneratorInstructionInterface.
- If your services or custom implementations previously relied on
-
A new parameter has been added to specify the validation groups for a given promotion action. If you have any custom validation groups for your promotion action, you need to add them to your
config/packages/_sylius.yamlfile. Additionally, if you have your own promotion action and want to add your validation groups, you can add another key to thepromotion_action.validation_groupsparameter. This is handled bySylius\Bundle\PromotionBundle\Validator\PromotionActionGroupValidatorand it resolves the groups based on the type of the passed promotion action.sylius_promotion: promotion_action: validation_groups: order_percentage_discount: - 'sylius' - 'sylius_promotion_action_order_percentage_discount' shipping_percentage_discount: - 'sylius' - 'sylius_promotion_action_shipping_percentage_discount' your_promotion_action: - 'sylius' - 'your_custom_validation_group'Along with this update, constraints have been removed from specific action form types. The affected form types include:
Sylius\Bundle\PromotionBundle\Form\Type\Action\FixedDiscountConfigurationTypeSylius\Bundle\PromotionBundle\Form\Type\Action\PercentageDiscountConfigurationTypeSylius\Bundle\PromotionBundle\Form\Type\Action\UnitFixedDiscountConfigurationTypeSylius\Bundle\PromotionBundle\Form\Type\Action\UnitPercentageDiscountConfigurationType
The constraints previously defined in these forms are now in
src/Sylius/Bundle/CoreBundle/Resources/config/validation/PromotionAction.xmland managed via the new validation groups parameters in the configuration. -
A new parameter has been added to specify the validation groups for a given promotion rule. If you have any custom validation groups for your promotion rule, you need to add them to your
config/packages/_sylius.yamlfile. Additionally, if you have your own promotion rule and want to add your validation groups, you can add another key to thepromotion_rule.validation_groupsparameter. This is handled bySylius\Bundle\PromotionBundle\Validator\PromotionRuleGroupValidatorand it resolves the groups based on the type of the passed promotion rule.sylius_promotion: promotion_rule: validation_groups: cart_quantity: - 'sylius' - 'sylius_promotion_rule_cart_quantity' customer_group: - 'sylius' - 'sylius_promotion_rule_customer_group' your_promotion_rule: - 'sylius' - 'your_custom_validation_group'Along with this update, constraints have been removed from specific rule form types. The affected form types include:
Sylius\Bundle\CoreBundle\Form\Type\Promotion\Rule\ContainsProductConfigurationTypeSylius\Bundle\CoreBundle\Form\Type\Promotion\Rule\NthOrderConfigurationTypeSylius\Bundle\PromotionBundle\Form\Type\Rule\CartQuantityConfigurationTypeSylius\Bundle\PromotionBundle\Form\Type\Rule\ItemTotalConfigurationType
The constraints previously defined in these forms are now in
src/Sylius/Bundle/CoreBundle/Resources/config/validation/PromotionRule.xmland managed via the new validation groups parameters in the configuration. -
The
Sylius\Component\Addressing\Repository\ZoneRepositoryInterfaceandSylius\Bundle\AddressingBundle\Repository\ZoneRepositorywere added. If you created a customZonerepository, you should update it to extend theSylius\Bundle\AddressingBundle\Repository\ZoneRepository -
The constructor of
Sylius\Component\Addressing\Matcher\ZoneMatcherhas been changed:use Sylius\Component\Addressing\Repository\ZoneRepositoryInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; public function __construct( - private RepositoryInterface $zoneRepository, + private RepositoryInterface|ZoneRepositoryInterface $zoneRepository, ) -
Moved classes from
CommandtoConsole\Command. TheCommandnamespace is deprecated for console command classes and will be removed in Sylius 2.0. List of affected classes:\Sylius\Bundle\OrderBundle\Command\RemoveExpiredCartsCommandto\Sylius\Bundle\OrderBundle\Console\Command\RemoveExpiredCartsCommand\Sylius\Bundle\PromotionBundle\Command\GenerateCouponsCommandto\Sylius\Bundle\PromotionBundle\Console\Command\GenerateCouponsCommand\Sylius\Bundle\UiBundle\Command\DebugTemplateEventCommandto\Sylius\Bundle\UiBundle\Console\Command\DebugTemplateEventCommand\Sylius\Bundle\UserBundle\Command\AbstractRoleCommandto\Sylius\Bundle\UserBundle\Console\Command\AbstractRoleCommand\Sylius\Bundle\UserBundle\Command\DemoteUserCommandto\Sylius\Bundle\UserBundle\Console\Command\DemoteUserCommand\Sylius\Bundle\UserBundle\Command\PromoteUserCommandto\Sylius\Bundle\UserBundle\Console\Command\PromoteUserCommand\Sylius\Bundle\CoreBundle\Command\Model\PluginInfoto\Sylius\Bundle\CoreBundle\Console\Command\Model\PluginInfo\Sylius\Bundle\CoreBundle\Command\AbstractInstallCommandto\Sylius\Bundle\CoreBundle\Console\Command\AbstractInstallCommand\Sylius\Bundle\CoreBundle\Command\CancelUnpaidOrdersCommandto\Sylius\Bundle\CoreBundle\Console\Command\CancelUnpaidOrdersCommand\Sylius\Bundle\CoreBundle\Command\CheckRequirementsCommandto\Sylius\Bundle\CoreBundle\Console\Command\CheckRequirementsCommand\Sylius\Bundle\CoreBundle\Command\InformAboutGUSCommandto\Sylius\Bundle\CoreBundle\Console\Command\InformAboutGUSCommand\Sylius\Bundle\CoreBundle\Command\InstallAssetsCommandto\Sylius\Bundle\CoreBundle\Console\Command\InstallAssetsCommand\Sylius\Bundle\CoreBundle\Command\InstallCommandto\Sylius\Bundle\CoreBundle\Console\Command\InstallCommand\Sylius\Bundle\CoreBundle\Command\InstallDatabaseCommandto\Sylius\Bundle\CoreBundle\Console\Command\InstallDatabaseCommand\Sylius\Bundle\CoreBundle\Command\InstallSampleDataCommandto\Sylius\Bundle\CoreBundle\Console\Command\InstallSampleDataCommand\Sylius\Bundle\CoreBundle\Command\JwtConfigurationCommandto\Sylius\Bundle\CoreBundle\Console\Command\JwtConfigurationCommand\Sylius\Bundle\CoreBundle\Command\SetupCommandto\Sylius\Bundle\CoreBundle\Console\Command\SetupCommand\Sylius\Bundle\CoreBundle\Command\ShowAvailablePluginsCommandto\Sylius\Bundle\CoreBundle\Console\Command\ShowAvailablePluginsCommand
-
In version 2.0 introduces a significant restructuring of our class system to enhance efficiency and clarity. The changes are as follows:
Messagewill be migrated toCommand.MessageDispatcherwill be migrated toCommandDispatcher.MessageHandlerwill be migrated toCommandHandler.- Example: Within the
Sylius\Bundle\CoreBundle, theMessageHandler\OrderHandlerclass will be migrated toCommandHandler\OrderHandler. This pattern will be mirrored across other bundles in the system.
-
The behavior of the
sylius:install:setupcommand has changed, becauseSylius\Bundle\CoreBundle\Installer\Setup\LocaleSetuphas been updated. Now, it automatically replaces the existinglocaleparameter in the configuration with the one provided for the store. -
A new parameter has been added to specify the validation groups for a given catalog promotion scope. If you have any custom validation groups for your catalog promotion scope, you need to add them to your
config/packages/_sylius.yamlfile. Additionally, if you have your own catalog promotion scope and want to add your validation groups, you can add another key to thecatalog_promotion_scope.validation_groupsparameter. This is handled bySylius\Bundle\PromotionBundle\Validator\CatalogPromotionScopeGroupValidatorand it resolves the groups based on the type of the passed catalog promotion scope.sylius_promotion: catalog_promotion_scope: validation_groups: for_products: - 'sylius' - 'sylius_catalog_promotion_scope_for_products' for_taxons: - 'sylius' - 'sylius_catalog_promotion_scope_for_taxons' your_scope: - 'sylius' - 'your_custom_validation_group'Along with this update, constraints have been removed from specific rule form types. The affected form types include:
Sylius\Bundle\CoreBundle\Form\Type\CatalogPromotionScope\ForProductsScopeConfigurationTypeSylius\Bundle\CoreBundle\Form\Type\CatalogPromotionScope\ForTaxonsScopeConfigurationTypeSylius\Bundle\CoreBundle\Form\Type\CatalogPromotionScope\ForVariantsScopeConfigurationType
The constraints previously defined in these forms are now in
src/Sylius/Bundle/CoreBundle/Resources/config/validation/CatalogPromotionScope.xmland managed via the new validation groups parameters in the configuration. -
A new parameter has been added to specify the validation groups for a given catalog promotion action. If you have any custom validation groups for your catalog promotion action, you need to add them to your
config/packages/_sylius.yamlfile. Additionally, if you have your own catalog promotion action and want to add your validation groups, you can add another key to thecatalog_promotion_action.validation_groupsparameter. This is handled bySylius\Bundle\PromotionBundle\Validator\CatalogPromotionActionGroupValidatorand it resolves the groups based on the type of the passed catalog promotion action.sylius_promotion: catalog_promotion_action: validation_groups: percentage_discount: - 'sylius' - 'sylius_catalog_promotion_action_percentage_discount' fixed_discount: - 'sylius' - 'sylius_catalog_promotion_action_fixed_discount' your_action: - 'sylius' - 'your_custom_validation_group'Along with this update, constraints have been removed from specific rule form types. The affected form types include:
Sylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionAction\FixedDiscountActionConfigurationTypeSylius\Bundle\PromotionBundle\Form\Type\CatalogPromotionAction\PercentageDiscountActionConfigurationType
The constraints previously defined in these forms are now in
src/Sylius/Bundle/PromotionBundle/Resources/config/validation/CatalogPromotionAction.xmlandsrc/Sylius/Bundle/CoreBundle/Resources/config/validation/CatalogPromotionAction.xmland are managed via the new validation groups parameters in the configuration. -
Since catalog promotion action and scope validations have been rewritten to be more inline with symfony, the previous abstraction has been deprecated. This includes:
Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionAction\ActionValidatorInterfaceSylius\Bundle\PromotionBundle\Validator\CatalogPromotionScope\ScopeValidatorInterfaceSylius\Bundle\PromotionBundle\Validator\CatalogPromotionActionValidatorSylius\Bundle\PromotionBundle\Validator\CatalogPromotionScopeValidator
-
Class
Sylius\Component\Promotion\Checker\Rule\CartQuantityRuleCheckerhas been deprecated. UseSylius\Component\Core\Promotion\Checker\Rule\CartQuantityRuleCheckerinstead. -
Class
Sylius\Component\Promotion\Checker\Rule\ItemTotalRuleCheckerhas been deprecated. UseSylius\Component\Core\Promotion\Checker\Rule\ItemTotalRuleCheckerinstead. -
The first parameter of the constructor in the
\Sylius\Component\Core\Promotion\Checker\Rule\ItemTotalRuleCheckerclass has been deprecated and will be removed in version 2.0. -
The service definition for
sylius.promotion_rule_checker.item_totalhas been updated. The class has been changed fromSylius\Component\Promotion\Checker\Rule\ItemTotalRuleCheckertoSylius\Component\Core\Promotion\Checker\Rule\ItemTotalRuleChecker. -
Sylius Mailer email configuration keys in the
src/Sylius/Bundle/CoreBundle/Resources/config/app/sylius/sylius_mailer.ymlfile have been changed:Deprecated:
sylius_mailer: emails: account_verification_token: subject: sylius.emails.user.verification_token.subjectNew:
sylius_mailer: emails: account_verification: subject: sylius.email.user.account_verification.subject -
Translation keys in the
Sylius\Bundle\CoreBundle\Resources\translations\messages.en.ymlunder thesylius.emailkey have been changed:Deprecated:
sylius: email: verification_token: hello: 'Hello' message: 'Verify your account with token: ' subject: 'Email address verification' to_verify_your_email_address: 'To verify your email address - click the link below' verify_your_email_address: 'Verify your email address'New:
sylius: email: user: account_verification: greeting: 'Hello' message: 'Verify your account with token: ' statement: 'Verify your email address' strategy: 'To verify your email address - click the link below' subject: 'Email address verification'
1 Extracted the section responsible for the ShopBundle from @SyliusCore/Email/accountVerification.html.twig and relocated it to @SyliusShop/Email/verification.html.twig.