- Bundles, container extensions and bundles configurations were made final and can't be extended anymore, follow Symfony best practices and do not extend them.
- Route
sylius_admin_order_shipment_ship
has been added to have specific end point only for updating via http PUT method andsylius_admin_partial_shipment_ship
route is only for rendering the form. - Rename any
sylius_admin_address_log_entry_index
usages tosylius_admin_partial_log_entry_index
. - Changed the way how payment methods are created. Now you choose desired gateway first and configure payment method with it. All parameters that were previously configured in
yml
configuration file are now managed for each payment method in the Admin panel.
-
Change the import path of your API routing from
src/Sylius/Bundle/ApiBundle/Resources/config/routing/main.yml
tosrc/Sylius/Bundle/ApiBundle/Resources/config/routing.yml
. API became versioned, so you need to prefix them accordingly (e.g./api/customer
->/api/v1/customer
). -
Routing definition for Shipping Categories has been removed and replaced with auto generated resource routing. Also, Shipping Categories are resolved by code instead of id. One can either change the way, how the routes are handled on theirs app (send
code
instead ofid
) or replace previous routing import with following definition:
sylius_api_shipping_category_index:
path: /
methods: [GET]
defaults:
_controller: sylius.controller.shipping_category:indexAction
_sylius:
serialization_version: $version
serialization_groups: [Default]
paginate: $limit
sortable: true
sorting:
name: desc
sylius_api_shipping_category_create:
path: /
methods: [POST]
defaults:
_controller: sylius.controller.shipping_category:createAction
_sylius:
serialization_version: $version
sylius_api_shipping_category_update:
path: /{id}
methods: [PUT, PATCH]
defaults:
_controller: sylius.controller.shipping_category:updateAction
_sylius:
serialization_version: $version
sylius_api_shipping_category_delete:
path: /{id}
methods: [DELETE]
defaults:
_controller: sylius.controller.shipping_category:deleteAction
_sylius:
serialization_version: $version
csrf_protection: false
sylius_api_shipping_category_show:
path: /{id}
methods: [GET]
defaults:
_controller: sylius.controller.shipping_category:showAction
_sylius:
serialization_version: $version
serialization_groups: [Detailed]
-
Routing definition for
Products
has been changed and products are now resolved by code instead of id. You can bring back previous configuration by overriding current routing with your definition. -
Routing definition for
Product Variants
has been changed and ProductVariants are now resolved by code instead of id. You can bring back previous configuration by overriding current routing with your definition. -
Routing definition for
Taxons
has been changed and Taxons are now resolved by code instead of id. You can bring back previous configuration by overriding current routing with your definition. -
Routing for the following resources has been removed and replaced with the auto generated routing:
Channels
, which are now resolved by code instead of id and only index and show endpoint are available.Countries
, which are now resolved by code instead of id.Locales
, which are now resolved by code instead of id.Product Attributes
, which are now by code instead of id and only index and show endpoint are available.Product Options
, which are now resolved by code instead of id and only index and show endpoint are available.Promotions
, which are now resolved by code instead of id.Promotions Coupons
, which are now resolved by code instead of id and only index and show endpoint are available.Tax Categories
, which are now resolved by code instead of id.Tax Rates
, which have now only index and show endpoint available.Payment Methods
, which have now only show endpoint available.
You can bring back previous configuration by overriding current routing with your definition.
-
AttributeValue::$localeCode
property was added to make it translatable. Now, every attribute value has a locale code to be displayed properly in different locales. All attribute values are migrated to the new concept with migrationVersion20170109143010
. Look at this PR if you have any problems with upgrade. -
Sylius\Component\Attribute\Repository\AttributeRepositoryInterface
and its implementations were removed due to not being used anymore. You can bring back missingfindByName
method by copying it from Git history to your codebase.
-
ImageUniqueCode
andImageUniqueCodeValidator
were deleted and replaced byUniqueWithinCollectionConstraintValidator
,UniqueWithinCollectionConstraint
fromResourceBundle
. To use it replace name of constraint in constraint mapping file from:Sylius\Bundle\CoreBundle\Validator\Constraints\ImageUniqueCode
to:Sylius\Bundle\ResourceBundle\Validator\Constraints\UniqueWithinCollectionConstraint
-
Renamed
getLastNewPayment()
onOrderInterface
togetLastPayment($state)
, where$state
is target last payment state. EverygetLastNewPayment()
method should be replaced withgetLastPayment(PaymentInterface::STATE_NEW)
. -
Sylius\Component\Core\OrderProcessing\OrderTaxesProcessor
andSylius\Component\Core\Resolver\ZoneAndChannelBasedShippingMethodsResolver
have become a zone scope aware. From now, only zones with scope 'shipping' or 'all' will be considered inSylius\Component\Core\Resolver\ZoneAndChannelBasedShippingMethodsResolver
and a scope 'tax' or 'all' is required inSylius\Component\Core\OrderProcessing\OrderTaxesProcessor
. A migration file has been prepared which fill in "all" as scope for zones that didn't have it specified, so they will be resolved by new implementation. -
State resolvers have been made final. In order to change theirs behavior please decorate them or provide your own implementation.
-
Sylius\Bundle\CoreBundle\DependencyInjection\Compiler\RoutingRepositoryPass
was removed, implement it yourself. -
Method
createQueryBuilderByChannelAndTaxonSlug
fromSylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepositoryInterface
was renamed tocreateShopListQueryBuilder
and receives taxon object instead of taxon slug string as the second parameter. -
Sylius\Bundle\CoreBundle\Test\MySqlDriver
andSylius\Bundle\CoreBundle\Test\PgSqlDriver
were moved to test namespace, provide your own implementation or use Doctrin DBAL'sDoctrine\DBAL\Driver\PDOMySql\Driver
andDoctrine\DBAL\Driver\PDOPgSql\Driver
instead. -
Sylius\Component\Core\Test\Services\RandomInvoiceNumberGenerator
was moved toSylius\Component\Core\Payment\RandomInvoiceNumberGenerator
, change your usages accordingly. -
Sylius\Component\Core\Payment\RandomInvoiceNumberGenerator
andSylius\Component\Core\Payment\IdBasedInvoiceNumberGenerator
were made final, use decoration and implementSylius\Component\Core\Payment\InvoiceNumberGeneratorInterface
instead of extending them. -
Sylius\Component\Core\Currency\SessionBasedCurrencyStorage
was removed and replaced by more genericSylius\Component\Core\Currency\CurrencyStorage
-
The following classes were removed due to being no longer used in current implementation:
Sylius\Bundle\CoreBundle\Handler\ShopCurrencyChangeHandler
Sylius\Component\Core\Currency\Handler\CompositeCurrencyChangeHandler
Sylius\Component\Core\Currency\Handler\CurrencyChangeHandlerInterface
Sylius\Component\Core\Provider\ChannelBasedCurrencyProvider
Sylius\Component\Core\SyliusCurrencyEvents
-
The following classes and interfaces was removed due to changes in locales handling (prepending them in URLs):
Sylius\Bundle\CoreBundle\Handler\CartLocaleChangeHandler
Sylius\Bundle\CoreBundle\Handler\ShopLocaleChangeHandler
Sylius\Component\Core\Locale\Handler\CompositeLocaleChangeHandler
Sylius\Component\Core\Locale\Handler\LocaleChangeHandlerInterface
-
Sylius\Component\Core\Repository\ProductRepositoryInterface
definition changed.-
findLatestByChannel(ChannelInterface $channel, int $count)
was changed tofindLatestByChannel(ChannelInterface $channel, string $locale, int $count)
. Please provide your current locale to fetch products together with their translations. -
findOneBySlugAndChannel(string $slug, ChannelInterface $channel)
was changed tofindOneByChannelAndSlug(ChannelInterface $channel, string $locale, string $slug)
. Please provide your current locale to fetch product together with its translations. -
findOneBySlug(string $slug)
was removed and replaced with more specificfindOneByChannelAndSlug(ChannelInterface $channel, string $locale, string $slug)
.
-
-
Added
Payment::$gatewayConfig
property (with corresponding getter and setter) to allow dynamic gateways. Use it instead of oldPayment::$gateway
property. -
Added custom
PaymentMethodFactory
withcreateWithGateway($gatewayFactory)
method. -
The following methods were added to
Sylius\Component\Core\Repository\OrderRepositoryInterface
:findCartForSummary($id): ?OrderInterface
findCartForAddressing($id): ?OrderInterface
findCartForSelectingShipping($id): ?OrderInterface
findCartForSelectingPayment($id): ?OrderInterface
-
Channel
relation was removed fromChannelPricing
model.Channel::$code
should be used instead. -
The following classes were moved to
ShopBundle
:Sylius\Bundle\CoreBundle\EmailManager\ContactEmailManager
Sylius\Bundle\CoreBundle\EmailManager\ContactEmailManagerInterface
Sylius\Bundle\CoreBundle\EmailManager\OrderEmailManagerInterface
Sylius\Bundle\CoreBundle\EmailManager\OrderEmailManager
Sylius\Bundle\CoreBundle\EventListener\UserMailerListener
-
The following email templates were moved to
ShopBundle
:SyliusShopBundle:Email:contactRequest.html.twig
SyliusShopBundle:Email:orderConfirmation.html.twig
SyliusShopBundle:Email:userRegistration.html.twig
SyliusShopBundle:Email:passwordReset.html.twig
SyliusShopBundle:Email:verification.html.twig
-
The following classes were moved to
AdminBundle
:Sylius\Bundle\CoreBundle\EmailManager\ShipmentEmailManager
Sylius\Bundle\CoreBundle\EmailManager\ShipmentEmailManagerInterface
-
The following email template was moved to
AdminBundle
:SyliusShopBundle:Email:shipmentConfirmation.html.twig
-
The following classes were removed due to being no longer used in current implementation:
Sylius\Component\Currency\Provider\CurrencyProviderInterface
Sylius\Component\Currency\Context\ProviderBasedCurrencyContext
Sylius\Component\Currency\Provider\CurrencyProvider
sylius_currency.currency
configuration option was removed as well assylius_currency.currency
parameter.
-
In
Sylius\Component\Grid\Definition\ArrayToDefinitionConverter
was changed a constructor, now the necessary property isSymfony\Component\EventDispatcher\EventDispatcherInterface
. -
Custom options for filter form types was extracted from
options
toform_options
in grid configuration.
Before:
sylius_grid:
grids:
app_order:
filters:
channel:
type: entity
options:
class: "%app.model.channel%"
fields: [channel]
After:
sylius_grid:
grids:
app_order:
filters:
channel:
type: entity
options:
fields: [channel]
form_options:
class: "%app.model.channel%"
- Grid configuration was upgraded to allow setting the number of maximum visible items per page on index.
sylius_grid:
grids:
app_order:
limits: [15, 20, 30]
Locale
model's$enabled
field has been removed along with all logic depending on it.
- Modified
SenderInterface::send
andAdapterInterface::send
methods, to take anattachments
array as the last, optional argument. - Upgraded
SwiftMailerAdapter
to take the new parameter into account. Theattachments
array should contain absolute paths to the files being sent with the email.
- Method
findOrdersUnpaidSince
ofSylius\Bundle\OrderBundle\Doctrine\ORM\OrderRepository
has been moved toSylius\Bundle\CoreBundle\Doctrine\ORM\OrderRepository
as it depends on Core component. If you haven't been using this method, you can remove the 'CoreBundle' dependency. - The
ExpiredCartsRemover
service has been moved from the component and into the bundle. In addition it dispatches thesylius.carts.pre_remove
andsylius.carts.post_remove
events, both of which hold the collection of carts to be, or already removed, depending on the event. Also, as of now, it depends on thesylius.manager.order
to remove the carts instead of the repository in order to not flush every outdatedcart
, but the whole collection.
- Changed default
Payment::$state
from new to cart. - Credit Card model and all related code have been removed.
->getSource()
and->setSource(PaymentSourceInterface $source)
have been removed fromPaymentInterface
.PaymentSourceInterface
has been removed.void
transition and state has been removed due to being not used.
-
There were changes made with handling payment states:
- authorized is treated as processing
- payedout is treated as refunded
-
Removed
Payment::$gateway
property and corresponding methods. -
Introduced
PaypalGatewayConfigurationType
andStripeGatewayConfigurationType
for dynamic gateways configuration.
ProductVariant::$name
property (and corresponding getter and setter) was removed to make it translatable. Therefore,ProductVariantTranslation
was introduced with one$name
property. All product variants names are migrated to new concept with migrationVersion2016121415313
. Look at this PR if you have any problems with upgrade.ProductAssociationType::$name
property (and corresponding getter and setter) was removed to make it translatable. Therefore,ProductAssociationTypeTranslation
was introduced with one$name
property. All product association types names are migrated to new concept with migrationVersion20161219160441
. Look at this PR if you have any problems with upgrade.Product::$availableOn
andProduct::$availableUntil
properties (and corresponding getters and setters) were removed. Look at this PR if you have any problems with upgrade.->findOneByCode($code)
has been replaced with->findOneByCodeAndProductCode($code, $productCode)
onProductVariantRepositoryInterface
.->findOneByIdAndProductId($id, $productId)
has been added toProductVariantRepository
.
- Removed
sylius_resource.resources.*.translation.fields
configuration key, it was not used at all - if causing issues, remove your configuration under it.
Service sylius.average_rating_updater
name has been changed to sylius.product_review.average_rating_updater
and service sylius.listener.review_change
name has been changed to sylius.listener.product_review_change
These services will be generated automatically based on subject name.
-
The following templates were moved:
@SyliusShop/Homepage/_header.html.twig
->@SyliusShop/_header.html.twig
@SyliusShop/Homepage/_footer.html.twig
->@SyliusShop/_footer.html.twig
@SyliusShop/Homepage/Menu/_security.html.twig
->@SyliusShop/Menu/_security.html.twig
@SyliusShop/_currencySwitch.html.twig
->@SyliusShop/Menu/_currencySwitch.html.twig
@SyliusShop/_localeSwitch.html.twig
->@SyliusShop/Menu/_localeSwitch.html.twig
-
HomepageController
has been made final and can't be extended anymore, follow Symfony best practices and do not extend it. Instead extend theSymfony\Bundle\FrameworkBundle\Controller\Controller
and override thesylius.controller.shop.homepage
service definition.
- Signature of method
findChildren(string $parentCode)
inSylius\Component\Taxonomy\Repository\TaxonRepositoryInterface
was changed tofindChildren(string $parentCode, string $locale)
.
Sylius\Bundle\ThemeBundle\Translation\Provider\Locale\FallbackLocalesProvider
andSylius\Bundle\ThemeBundle\Translation\Provider\Locale\FallbackLocalesProviderInterface
have been removed.- The fallback locales generation of
Sylius\Bundle\ThemeBundle\Translation\Translator
has been nerfed to more strongly rely on symfony's default logic. From now on it won't compute every possible permutation of fallback locales from the given one, but only the themeless version, the base locale with and without theme's modifier, and every pre-configured fallback with and without the modifier.
-
Sylius\Bundle\UiBundle\Menu\AbstractMenuBuilder
was removed, you should add the following code to classes previously extending it:use Knp\Menu\FactoryInterface; use Symfony\Component\EventDispatcher\EventDispatcher; /** * @var FactoryInterface */ private $factory; /** * @var EventDispatcher */ private $eventDispatcher; /** * @param FactoryInterface $factory * @param EventDispatcher $eventDispatcher */ public function __construct(FactoryInterface $factory, EventDispatcher $eventDispatcher) { $this->factory = $factory; $this->eventDispatcher = $eventDispatcher; }
Also
sylius.menu_builder
service was removed, you should add the following code to services previously extending it:<argument type="service" id="knp_menu.factory" /> <argument type="service" id="event_dispatcher" />
-
sylius_admin_dashboard_redirect
route was removed, usesylius_admin_dashboard
instead. -
All shop routes became prepended with locale code, see below for required routing and security changes.
-
Shop only shows products / taxons having translations in current language.
-
Move
sylius_shop
routing belowsylius_admin
andsylius_api
inapp/config/routing.yml
and replace it with the following one:sylius_shop: resource: "@SyliusShopBundle/Resources/config/routing.yml" prefix: /{_locale} requirements: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ sylius_shop_default_locale: path: / methods: [GET] defaults: _controller: sylius.controller.shop.locale_switch:switchAction
-
Payum gateways configuration is now done in Admin panel. Don't use
yml
file to configure your custom gateways. -
While providing multiple locales you need to insert the two letter base (i.e.
en
), along with the%locale%
parameter, to the fallbacks array inapp/config/config.yml
.framework: translator: { fallbacks: ["%locale%", "en"] }
-
Payum routes were made independent of the current locale. Add the following code to
app/config/routing.yml
:sylius_shop_payum: resource: "@SyliusShopBundle/Resources/config/routing/payum.yml"
-
Add exception config to
fos_rest
inconfig.yml
:
fos_rest:
exception: ~
-
Firewalls configuration was changed to provide better CSRF protection and turn on remember me feature, update your
app/config/security.yml
:security: firewalls: admin: form_login: csrf_token_generator: security.csrf.token_manager csrf_parameter: _csrf_admin_security_token csrf_token_id: admin_authenticate remember_me: secret: "%secret%" path: /admin name: APP_ADMIN_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me shop: form_login: csrf_token_generator: security.csrf.token_manager csrf_parameter: _csrf_shop_security_token csrf_token_id: shop_authenticate remember_me: secret: "%secret%" name: APP_SHOP_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me
From now on you need to pass CSRF token to your login-check request so you need to add
<input type="hidden" value={{ csrf_token('csrf_token_id') }} name="csrf_parameter">
into your login form. Example input for admin login looks like<input type="hidden" name="_csrf_admin_security_token" value="{{ csrf_token('admin_authenticate') }}">
.The remember me feature did not work properly due to missing additional configuration.
-
Securing partial routes and prepending shop URLs with locales need changes in
access_control
section of yourapp/config/security.yml
:security: access_control: - { path: "^/[^/]++/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] } - { path: "^/[^/]++/_partial", role: ROLE_NO_ACCESS } - { path: "^/[^/]++/login", role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: "^/(?!admin|api)[^/]++/register", role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: "^/(?!admin|api)[^/]++/verify", role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: "^/admin", role: ROLE_ADMINISTRATION_ACCESS } - { path: "^/api", role: ROLE_API_ACCESS } - { path: "^/(?!admin|api)[^/]++/account", role: ROLE_USER }
Sylius\Behat\Page\Admin\Crud\IndexPage
,Sylius\Behat\Page\Admin\Crud\CreatePage
,Sylius\Behat\Page\Admin\Crud\UpdatePage
now accepts route name instead of resource name.