5.9 KiB
UPGRADE FROM v1.10.0 TO v1.10.1
-
API is disabled by default, to enable it you need to set flag to
trueinapp/config/packages/_sylius.yaml:sylius_api: enabled: true
UPGRADE FROM v1.9.X TO v1.10.0
Admin API Bundle Removal
Sylius v1.10 extracts AdminApiBundle outside the core package. You might choose either to keep that bundle or remove it in case it's not used.
Keeping Admin API Bundle
- Add Admin API Bundle to your application by running the following command:
composer require sylius/admin-api-bundle
Removing Admin API Bundle
- Before installing Sylius 1.10, run the following command to adjust the database schema:
bin/console doctrine:migrations:execute Sylius\\Bundle\\AdminApiBundle\\Migrations\\Version20161202011556 Sylius\\Bundle\\AdminApiBundle\\Migrations\\Version20170313125424 Sylius\\Bundle\\AdminApiBundle\\Migrations\\Version20170711151342 --down
- After installing Sylius v1.10, remove the remaining configuration by following the changes in this PR:
- remove
friendsofsymfony/oauth-server-bundlefrom yourcomposer.jsonand runcomposer update - remove
FOS\OAuthServerBundle\FOSOAuthServerBundleandSylius\Bundle\AdminApiBundle\SyliusAdminApiBundlefromconfig/bundles.php - remove
@SyliusAdminApiBundle/Resources/config/app/config.ymlimport fromconfig/packages/_sylius.yaml - remove
sylius_admin_apipackage configuration fromconfig/packages/_sylius.yaml - remove
oauth_tokenandapifirewalls fromconfig/security.yaml - remove
sylius.security.api_regexparameter and all its usage in access control fromconfig/security.yaml - remove
config/routes/sylius_admin_api.yamlfile - remove all classes from
src/Entity/AdminApidirectory
Buses
- Message buses
sylius_default.busandsylius_event.bushas been deprecated. Usesylius.command_busandsylius.event_businstead.
Shop & Core Decoupled
-
Sylius\Bundle\CoreBundle\EventListener\CartBlamerListenerhas been moved from CoreBundle to ShopBundle, renamed toSylius\Bundle\ShopBundle\EventListener\ShopCartBlamerListenerand adjusted to work properly when decoupled. -
Sylius\Bundle\CoreBundle\EventListener\UserCartRecalculationListenerhas been moved from CoreBundle to ShopBundle asSylius\Bundle\ShopBundle\EventListener\UserCartRecalculationListenerand adjusted to work properly when decoupled.
API v2 changes (/api/v2)
-
API CartShippingMethod key
costhas been changed toprice. -
API Ship Shipment endpoint (PATCH api/v2/admin/shipments/{id}/ship) body value
trackinghas been changed totrackingCode. -
To have better control over the serialization process, we introduced
shopandadminprefixes to names of serialization groups onsrc/Sylius/Bundle/ApiBundle/Resources/config/api_resources/*andsrc/Sylius/Bundle/ApiBundle/Resources/config/serialization/*. Several additional serialization groups have been rephrased, to improve readability and predictability of them. If you are using they on your custom entityapi_resourceconfiguration or serialization groups, you should check if one of these changes may affect on your app. If yes, change all occurs by this pattern:
-
product_review:updatechanged to:admin:product_review:updateandshop:product_review:update -
product_association_typechanged to:admin:product_association_type -
product_optionchanged to:admin:product_option -
product_option_valuechanged to:admin:product_option_value -
product_taxonchanged to:admin:product_taxonandshop:product_taxon -
product_variantchanged to:admin:product_variantandshop:product_variant -
taxon_translationchanged to:admin:taxon_translationandshop:taxon_translation
-
We've removed
Sylius\Bundle\ApiBundle\ApiPlatform\Bridge\Doctrine\ORM\SubresourceDataProvider. It's no longer needed becauseApiPlatform\Core\Bridge\Doctrine\Orm\SubresourceDataProviderhas the same logic. -
API Change Quantity endpoint
PATCH api/v2/admin/orders/{tokenValue}/change-quantityhas been changed toPATCH api/v2/admin/orders/{tokenValue}/items/{orderItemId}and its body valueorderItemIdhas been removed (now it is a route parameter) andnewQuantityhas been renamed toquantity. -
API Add to cart endpoint
PATCH /api/v2/shop/orders/{tokenValue}/itemsno longer requiresproductCodein request body. -
Channel pricing resource and its serialization has been removed from shop section
-
Sylius\Bundle\ApiBundle\DataProvider\AddressCollectionDataProviderhas been removed in favour ofSylius\Bundle\ApiBundle\Doctrine\QueryCollectionExtension\AddressesExtension -
Second argument of
Sylius\Bundle\ApiBundle\DataPersister\AddressDataPersisterhas been changed fromCustomerContextInterface $customerContexttoUserContextInterface $userContext
Commands
-
We've removed
productCodefromSylius\Bundle\ApiBundle\Command\Cart\AddItemToCartcommand. -
Endpoints with changed code to IRI:
PATCH on /api/v2/shop/account/orders/{tokenValue}/payments/{paymentId}:
{
- "paymentMethodCode": "string"
+ "paymentMethod": "string"
}
POST on /api/v2/shop/product-reviews:
{
"title": "string",
"rating": 0,
"comment": "string",
- "productCode": "string",
+ "product": "string",
"email": "string"
}
POST on /api/v2/shop/reset-password-requests:
{
- "localeCode": "string"
+ "locale": "string"
}
POST on api/v2/shop/account-verification-requests:
{
- "localeCode": "string"
+ "locale": "string"
}
PATCH on /api/v2/shop/account/orders/{tokenValue}/shipments/{shipmentId}:
{
- "shippingMethodCode": "string"
+ "shippingMethod": "string"
}
PATCH on /api/v2/shop/account/orders/{tokenValue}/items:
{
- "productVariantCode": "string"
+ "productVariant": "string"
}