This document covers the extent of changes done during the transition from branches 2.* to 3.0.
This bundle now supports Symfony 3 and 4.
Everything marked as deprecated in 1.1 has been finally removed in this version. Refer to 1.1 changelog to see what was deleted.
There were inconsistent service definitions IDs for display and resource contexts and these were replaced with ones matching the rest of services. Below is a list of replaced services and parameters:
2.1 | 3.* |
---|---|
Deprecated value | New value |
%admin.display.context.class% | %admin.context.display.class% |
%admin.display.context% | %admin.context.display% |
%admin.display.context.request_handler.class% | %admin.context.display.request_handler.class% |
%admin.display.context.request_handler% | %admin.context.display.request_handler% |
%admin.resource.context.class% | %admin.context.resource.class% |
%admin.resource.context.form_builder.class% | %admin.context.resource.form_builder.class% |
%admin.resource.context.request_handler.form_submit.class% | %admin.context.resource.request_handler.form_submit.class% |
%admin.resource.context.request_handler.form_valid_request.class% | %admin.context.resource.request_handler.form_valid_request.class% |
%admin.resource.context.form_builder% | %admin.context.resource.form_builder% |
%admin.resource.context% | %admin.context.resource% |
%admin.resource.context.request_handler.form_submit% | %admin.context.resource.request_handler.form_submit% |
%admin.resource.context.request_handler.form_valid_request% | %admin.context.resource.request_handler.form_valid_request% |
This template is never used and was only left for backwards compatibility's sake. Now it is removed.
ControllerAbstract now has the EventDispatcher
passed into it's constructor instead through the setEventDispatcher
method. Due to
this change, the compiler pass
became redundant and was removed.
Previously default response templates were injected into controllers and could have been overwritten by a value returned by the context handling the element. This behaviour split the responsibilty of providing the template name between two classes, which caused inconsitency and was problematic, since controllers can handle vastly different elements. Now all contexts are required to provide a template name, assuming their action returns an HTML response. For example Batch actions will return a redirect response, so there is no point for them to provide one.
Until now options passed into AbstractElement were
resolved immediately in the class' constructor, but now it is postponed until
the first use of getOption
, hasOption
or getOptions
methods.
The $options
property has also been made private to ensure they are not resolved
somewhere else in extending classes, so if you access it directly in your elements,
you will need to use the appropriate getter method instead.
AbstractCRUD was marked as deprecated and was removed in favour of GenericCRUDElement.
Element has had the setDefaultOptions
method renamed
to configureOptions
, mirroring the change of Symfony's form component.
It was simplified to make it more accessible to use. The \FSi\Bundle\AdminBundle\Display\DisplayView
and FSi\Bundle\AdminBundle\Display\View
classes were dropped and now the data between
Display and DisplayContext
is passed directly. Also, the data formatters are applied immediately after the
value is added to the Display, instead during creation of
the FSi\Bundle\AdminBundle\Display\DisplayView
.
Please refer to Display components documentation for more information.
\FSi\Bundle\AdminBundle\Event\DisplayEvent
now has fourth constructor argument which is the original
data extracted by DataIndexer
As of this version, FSi\Bundle\AdminBundle\Admin\CRUD\Context\Request\BatchFormValidRequestHandler
requires the FlashMessages
as the third constructor parameter.
Two news events are being fired when each objects has an batch action applied to it. The events are:
Event name | Event class |
---|---|
admin.batch.object.pre_apply | FSi\Bundle\AdminBundle\Event\BatchPreApplyEvent |
admin.batch.object.post_apply | FSi\Bundle\AdminBundle\Event\BatchEvent |
The event class FSi\Bundle\AdminBundle\Event\BatchPreApplyEvent
also has a property
called skip
, which you can use to mark an object to be skipped when applying actions.
This option was introduced to make admin elements registration easier. With the introduction of service configuration defaults in the dependency injection component, it has became redundant and will be removed.
Refer to 1.1 changelog for information on which routes have been removed.
To be able to fully utilize new functionality introduced in 7.1, we have decided to only support PHP versions equal or higher to it. All bundle's classes and interfaces utilize new php 7.1 features like scalar typehints, return typehints and nullable types.
All public methods of FSi\Bundle\AdminBundle\Message\FlashMessages
now has more logical arguments order:
string $message, array $params = [], string $domain = 'FSiAdminBundle'
instead of previous
string $message, string $domain = 'FSiAdminBundle, array $params = []'
When attempting to delete entities with restricting relations, you would normally receive a SQL eror. Now it is caught and an error flash message is displayed.