10 KiB
UPGRADE FROM v1.12.x TO v1.13.0
-
All the
:readserialization groups are now split toindexandshow. By this change, the:readserialization group is now deprecated and will no more used in the future. There is a BC layer that will allow you to use the:readserialization groupSylius\Bundle\ApiBundle\SerializerContextBuilder\ReadOperationContextBuilderby adding thereadserialization group to your context. Inside of this service there are 2 configurable parameters$skipAddingReadGroupand$skipAddingIndexAndShowGroupsthat will allow you to skip adding the chosen serialization group to your context. To configure skipping adding the index and show or read serialization groups to the context, add the following configuration to yourconfig/packages/_sylius.yamlfile:sylius_api: serialization_groups: skip_adding_index_and_show_groups: true skip_adding_read_group: true -
Sylius serialization groups have been updated with a new prefix of
sylius:some_resource. If you extend any of the Sylius resources, you should update your serialization groups to use the new prefix. Non-prefix serialization groups are deprecated and will be removed in Sylius 2.0. -
The constructor of
Sylius\Bundle\ApiBundle\Serializer\ChannelDenormalizerhas been changed:public function __construct( private FactoryInterface $channelPriceHistoryConfigFactory, + private FactoryInterface $shopBillingDataFactory ) { } -
The constructor of
Sylius\Bundle\ApiBundle\EventSubscriber\TaxonDeletionEventSubscriberhas changed:public function __construct( private ChannelRepositoryInterface $channelRepository, + private TaxonInPromotionRuleCheckerInterface $taxonInPromotionRuleChecker, ) { } -
The signature of constructor of
Sylius\Bundle\ApiBundle\Command\Account\ChangeShopUserPasswordcommand changed:public function __construct( - public ?string $newPassword, + public string $newPassword, - public ?string $confirmNewPassword, + public string $confirmNewPassword, - public ?string $currentPassword, + public string $currentPassword, ) { } -
The constructor signature of
Sylius\Bundle\ApiBundle\Command\Catalog\AddProductReviewchanged:public function __construct( - public ?string $title, + public string $title, - public ?int $rating, + public int $rating, - public ?string $comment, + public string $comment, public string $productCode, public ?string $email = null, ) { } -
The constructor signature of
Sylius\Bundle\ApiBundle\Command\Account\VerifyCustomerAccountchanged:public function __construct( - public $token, + public string $token, + public ?string $channelCode = null, + public ?string $localeCode = null, ) { } -
The item operation paths for ProductVariantTranslation resource changed:
GET /admin/product-variant-translation/{id}->GET /admin/product-variant-translations/{id}GET /shop/product-variant-translation/{id}->GET /shop/product-variant-translations/{id}
-
Typo in the constraint validator's alias returned by
Sylius\Bundle\ApiBundle\Validator\Constraints\ChangedItemQuantityInCartValidator::validatedByhas been fixed. Previously it wassylius_api_validator_changed_item_guantity_in_cartand now it issylius_api_validator_changed_item_quantity_in_cart. -
The
ApiPlatform\Core\Bridge\Symfony\Bundle\Action\SwaggerUiActioncontroller has been removed. Therefore, theapi_platform.swagger.action.uiservice ID points to the API Platform'sSwaggerUiActioncontroller. -
The following services have been removed:
Sylius\Bundle\ApiBundle\Swagger\AdminAuthenticationTokenDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\ShopAuthenticationTokenDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\ProductDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\ProductImageDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\ProductSlugDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\ProductVariantDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\ShippingMethodDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\PathHiderDocumentationNormalizerSylius\Bundle\ApiBundle\Swagger\AcceptLanguageHeaderDocumentationNormalizer
Responsibility of these services has been moved to the corresponding services tagged with
sylius.open_api.modifier:Sylius\Bundle\ApiBundle\OpenApi\Documentation\AdminAuthenticationTokenDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\ShopAuthenticationTokenDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\ProductDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\ProductImageDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\ProductSlugDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\ProductVariantDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\ShippingMethodDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\PathHiderDocumentationModifierSylius\Bundle\ApiBundle\OpenApi\Documentation\AcceptLanguageHeaderDocumentationModifier
-
All usages of
ApiPlatform\Core\Api\IriConverterInterfacehave been switched to its non-deprecated counterpartApiPlatform\Api\IriConverterInterface. Due to that, the constructor and usage in the following classes have been changed accordingly:Sylius\Bundle\ApiBundle\Controller\GetProductBySlugActionSylius\Bundle\ApiBundle\Controller\UploadAvatarImageActionSylius\Bundle\ApiBundle\EventListener\AdminAuthenticationSuccessListenerSylius\Bundle\ApiBundle\EventListener\AuthenticationSuccessListenerSylius\Bundle\ApiBundle\Filter\Doctrine\CatalogPromotionChannelFilterSylius\Bundle\ApiBundle\Filter\Doctrine\ProductVariantCatalogPromotionFilterSylius\Bundle\ApiBundle\Filter\Doctrine\ProductVariantOptionValueFilterSylius\Bundle\ApiBundle\Filter\Doctrine\ProductVariantOptionValueFilterSylius\Bundle\ApiBundle\Filter\Doctrine\TaxonFilterSylius\Bundle\ApiBundle\Serializer\ChannelPriceHistoryConfigDenormalizerSylius\Bundle\ApiBundle\Serializer\ProductNormalizerSylius\Bundle\ApiBundle\Serializer\ProductVariantNormalizerSylius\Bundle\ApiBundle\Serializer\ZoneDenormalizer
-
The
Sylius\Bundle\ApiBundle\Filter\Doctrine\CatalogPromotionChannelFilterservice and class has been renamed toSylius\Bundle\ApiBundle\Filter\Doctrine\ChannelsAwareChannelFilter. -
The
sylius.api.product_taxon_filterfilter has been removed and its functionality has been superseded by thesylius.api.search_filter.taxon.codefilter. The usage stays the same. -
Update in Translations Handling
The process for creating or updating translations via the API has been refined. Now, the locale for each translation is determined directly from its key, making the explicit transmission of the
localefield redundant. Although the API continues to support the explicit sending of thelocalefield, it is essential that this explicitly sent locale matches the key in the translation array. In cases of a mismatch between the key and an explicitly sent locale, the API will respond with aSylius\Bundle\ApiBundle\Exception\TranslationLocaleMismatchException. -
The following Command Handlers constructor signatures have changed:
Sylius\Bundle\ApiBundle\CommandHandler\Account\SendAccountRegistrationEmailHandler:use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; - use Sylius\Component\Mailer\Sender\SenderInterface; use Sylius\Component\User\Repository\UserRepositoryInterface; + use Sylius\Bundle\CoreBundle\Mailer\AccountRegistrationEmailManagerInterface; public function __construct( + private AccountRegistrationEmailManagerInterface $accountRegistrationEmailManager, private UserRepositoryInterface $shopUserRepository, private ChannelRepositoryInterface $channelRepository, - private SenderInterface $emailSender, ) { }Sylius\Bundle\ApiBundle\CommandHandler\Account\SendAccountVerificationEmailHandler:use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; - use Sylius\Component\Mailer\Sender\SenderInterface; use Sylius\Component\User\Repository\UserRepositoryInterface; + use Sylius\Bundle\CoreBundle\Mailer\AccountVerificationEmailManagerInterface; public function __construct( + private AccountVerificationEmailManagerInterface $accountVerificationEmailManager, private UserRepositoryInterface $shopUserRepository, private ChannelRepositoryInterface $channelRepository, - private SenderInterface $emailSender, ) { }Sylius\Bundle\ApiBundle\CommandHandler\Account\SendResetPasswordEmailHandler:use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; - use Sylius\Component\Mailer\Sender\SenderInterface; use Sylius\Component\User\Repository\UserRepositoryInterface; + use Sylius\Bundle\CoreBundle\Mailer\ResetPasswordEmailManagerInterface; public function __construct( + private ResetPasswordEmailManagerInterface $resetPasswordEmailManager, private UserRepositoryInterface $shopUserRepository, private ChannelRepositoryInterface $channelRepository, - private SenderInterface $emailSender, ) { }Sylius\Bundle\CoreBundle\MessageHandler\Admin\Account\SendResetPasswordEmailHandler:- use Sylius\Component\Mailer\Sender\SenderInterface; use Sylius\Component\User\Repository\UserRepositoryInterface; + use Sylius\Bundle\CoreBundle\Mailer\ResetPasswordEmailManagerInterface; public function __construct( + private ResetPasswordEmailManagerInterface $resetPasswordEmailManager, private UserRepositoryInterface $shopUserRepository, - private SenderInterface $emailSender, ) { }