2.6 KiB
2.6 KiB
UPGRADE FROM 4.1 to 4.2
Cache
- Deprecated
CacheItem::getPreviousTags()
, useCacheItem::getMetadata()
instead.
Config
- Deprecated constructing a
TreeBuilder
without passing root node information.
DoctrineBridge
- The
lazy
attribute ondoctrine.event_listener
tags was removed. Listeners are now lazy by default. So anylazy
attributes can safely be removed from those tags.
Form
-
Deprecated calling
FormRenderer::searchAndRenderBlock
for fields which were already rendered. Instead of expecting such calls to return empty strings, check if the field has already been rendered.Before:
{% for field in fieldsWithPotentialDuplicates %} {{ form_widget(field) }} {% endfor %}
After:
{% for field in fieldsWithPotentialDuplicates if not field.rendered %} {{ form_widget(field) }} {% endfor %}
FrameworkBundle
- The
framework.router.utf8
configuration option has been added. If your app's charset is UTF-8 (see kernel'sgetCharset()
method), it is recommended to set it totrue
: this will generate 404s for non-UTF-8 URLs, which are incompatible with you app anyway, and will allow dumping optimized routers and using Unicode classes in requirements.
Security
- Using the
has_role()
function in security expressions is deprecated, use theis_granted()
function instead. - Not returning an array of 3 elements from
FirewallMapInterface::getListeners()
is deprecated, the 3rd element must be an instance ofLogoutListener
ornull
. - Passing custom class names to the
Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver
to define custom anonymous and remember me token classes is deprecated. To use custom tokens, extend the existingSymfony\Component\Security\Core\Authentication\Token\AnonymousToken
orSymfony\Component\Security\Core\Authentication\Token\RememberMeToken
.
SecurityBundle
- Passing a
FirewallConfig
instance as 3rd argument to theFirewallContext
constructor is deprecated, pass aLogoutListener
instance instead. - Using the
security.authentication.trust_resolver.anonymous_class
andsecurity.authentication.trust_resolver.rememberme_class
parameters to define the token classes is deprecated. To use custom tokens extend the existing AnonymousToken and RememberMeToken.
Serializer
- Relying on the default value (false) of the "as_collection" option is deprecated since 4.2. You should set it to false explicitly instead as true will be the default value in 5.0.