Skip to content

Latest commit

 

History

History
200 lines (158 loc) · 7.79 KB

CHANGELOG-3.0.md

File metadata and controls

200 lines (158 loc) · 7.79 KB

CHANGELOG for 3.0

This document covers the extent of changes done during the transition from branches 2.* to 3.0.

Symfony 3 and 4 support

This bundle now supports Symfony 3 and 4.

Removed deprecated classes and options from version 1.1

Everything marked as deprecated in 1.1 has been finally removed in this version. Refer to 1.1 changelog to see what was deleted.

Removed deprecated aliases and parameters from version 2.1

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%

Removed CRUD/form.html.twig

This template is never used and was only left for backwards compatibility's sake. Now it is removed.

ControllerAbstract gets the EventDispatcher through the constructor

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.

Default response templates are injected into contexts

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.

Resolving Admin\AbstractElement options only on first use

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.

Removed deprecated AbstractCRUD element

AbstractCRUD was marked as deprecated and was removed in favour of GenericCRUDElement.

Renamed setDefaultOptions to configureOptions in Element interface

Element has had the setDefaultOptions method renamed to configureOptions, mirroring the change of Symfony's form component.

Refactored Display 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.

DisplayEvent gets original data in constructor

\FSi\Bundle\AdminBundle\Event\DisplayEvent now has fourth constructor argument which is the original data extracted by DataIndexer

BatchFormValidRequestHandler requires FlashMessages

As of this version, FSi\Bundle\AdminBundle\Admin\CRUD\Context\Request\BatchFormValidRequestHandler requires the FlashMessages as the third constructor parameter.

Added events fired before and after applying a batch action

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.

Deprecated annotation as service registration for elements

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.

Dropped routes deprecated back in 1.1

Refer to 1.1 changelog for information on which routes have been removed.

Dropped support for PHP below 7.1

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.

Reordered arguments in FSi\Bundle\AdminBundle\Message\FlashMessages methods

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 = []'

Catching Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException on batch delete

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.