Skip to content

Commit

Permalink
4.7.0 (#7699)
Browse files Browse the repository at this point in the history
* 4.7.0

* Update CHANGELOG.md

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>

Co-authored-by: Javier Spagnoletti <phansys@gmail.com>
  • Loading branch information
VincentLanglet and phansys committed Jan 6, 2022
1 parent 5d64ebc commit dc55fcb
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 53 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,22 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.7.0](https://github.com/sonata-project/SonataAdminBundle/compare/4.6.1...4.7.0) - 2022-01-05
### Added
- [[#7685](https://github.com/sonata-project/SonataAdminBundle/pull/7685)] Support for `symfony/translation-contracts` 3.x ([@jordisala1991](https://github.com/jordisala1991))
- [[#7653](https://github.com/sonata-project/SonataAdminBundle/pull/7653)] "export_format_xlsx" translations ([@willemverspyck](https://github.com/willemverspyck))
- [[#7658](https://github.com/sonata-project/SonataAdminBundle/pull/7658)] `AdminInterface::showInDashboard()` method ([@VincentLanglet](https://github.com/VincentLanglet))

### Changed
- [[#7662](https://github.com/sonata-project/SonataAdminBundle/pull/7662)] Twig extensions are now lazy ([@VincentLanglet](https://github.com/VincentLanglet))

### Deprecated
- [[#7658](https://github.com/sonata-project/SonataAdminBundle/pull/7658)] `AdminInterface::showIn()` method ([@VincentLanglet](https://github.com/VincentLanglet))

### Fixed
- [[#7674](https://github.com/sonata-project/SonataAdminBundle/pull/7674)] Multiple choice field with predefined default values ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#7673](https://github.com/sonata-project/SonataAdminBundle/pull/7673)] Order of provided IDs at `ModelsToArrayTransformer::reverseTransform()` ([@VincentLanglet](https://github.com/VincentLanglet))

## [4.6.1](https://github.com/sonata-project/SonataAdminBundle/compare/4.6.0...4.6.1) - 2021-12-23
### Fixed
- [[#7669](https://github.com/sonata-project/SonataAdminBundle/pull/7669)] Model_autocomplete_type template ([@VincentLanglet](https://github.com/VincentLanglet))
Expand Down
2 changes: 1 addition & 1 deletion src/Action/SetObjectFieldValueAction.php
Expand Up @@ -76,7 +76,7 @@ public function __construct(
// NEXT_MAJOR: Remove the deprecation and restrict param constructor to RenderElementRuntime.
if (null === $renderElementRuntime) {
@trigger_error(sprintf(
'Passing null as argument 5 of "%s()" is deprecated since sonata-project/admin-bundle 4.x'
'Passing null as argument 5 of "%s()" is deprecated since sonata-project/admin-bundle 4.7'
.' and will throw an error in 5.0. You MUST pass an instance of %s instead.',
__METHOD__,
RenderElementRuntime::class
Expand Down
8 changes: 4 additions & 4 deletions src/Admin/AbstractAdmin.php
Expand Up @@ -1598,13 +1598,13 @@ public function showInDashboard(): bool
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use showInDashboard instead
* @deprecated since sonata-project/admin-bundle version 4.7 use showInDashboard instead
*/
final public function showIn(string $context): bool
{
if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) {
@trigger_error(sprintf(
'The "%s()" method is deprecated since sonata-project/admin-bundle version 4.x and will be'
'The "%s()" method is deprecated since sonata-project/admin-bundle version 4.7 and will be'
.' removed in 5.0 version. Use showInDashboard() instead.',
__METHOD__
), \E_USER_DEPRECATED);
Expand Down Expand Up @@ -2197,15 +2197,15 @@ protected function getAccessMapping(): array
*
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x
* @deprecated since sonata-project/admin-bundle version 4.7
*
* @return string[]
*/
protected function getPermissionsShow(string $context): array
{
if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) {
@trigger_error(sprintf(
'The "%s()" method is deprecated since sonata-project/admin-bundle version 4.x and will be'
'The "%s()" method is deprecated since sonata-project/admin-bundle version 4.7 and will be'
.' removed in 5.0 version.',
__METHOD__
), \E_USER_DEPRECATED);
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/AdminInterface.php
Expand Up @@ -273,7 +273,7 @@ public function getFilterParameters(): array;
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use showInDashboard instead
* @deprecated since sonata-project/admin-bundle version 4.7 use showInDashboard instead
*/
public function showIn(string $context): bool;

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Pool.php
Expand Up @@ -120,7 +120,7 @@ public function getDashboardGroups(): array
}
} else {
@trigger_error(sprintf(
'Not implementing "%s::showInDashboard()" is deprecated since sonata-project/admin-bundle 4.x'
'Not implementing "%s::showInDashboard()" is deprecated since sonata-project/admin-bundle 4.7'
.' and will fail in 5.0.',
AdminInterface::class
), \E_USER_DEPRECATED);
Expand Down
28 changes: 14 additions & 14 deletions src/Resources/config/twig.php
Expand Up @@ -52,8 +52,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.admin.twig.extension', 'sonata.admin.twig.sonata_admin_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.sonata_admin_runtime', SonataAdminRuntime::class)
Expand All @@ -72,8 +72,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.templates.twig.extension', 'sonata.admin.twig.template_registry_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.template_registry_runtime', TemplateRegistryRuntime::class)
Expand All @@ -93,8 +93,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.admin.group.extension', 'sonata.admin.twig.group_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.group_runtime', GroupRuntime::class)
Expand Down Expand Up @@ -123,8 +123,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.security.twig.extension', 'sonata.admin.twig.security_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.security_runtime', SecurityRuntime::class)
Expand All @@ -143,8 +143,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.canonicalize.twig.extension', 'sonata.admin.twig.canonicalize_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.canonicalize_runtime', CanonicalizeRuntime::class)
Expand All @@ -163,8 +163,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.xeditable.twig.extension', 'sonata.admin.twig.xeditable_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.xeditable_runtime', XEditableRuntime::class)
Expand All @@ -184,8 +184,8 @@
// NEXT_MAJOR: Remove the alias.
->alias('sonata.render_element.twig.extension', 'sonata.admin.twig.render_element_extension')
->deprecate(...BCDeprecationParameters::forConfig(
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.',
'4.x'
'The "%alias_id%" alias is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.',
'4.7'
))

->set('sonata.admin.twig.render_element_runtime', RenderElementRuntime::class)
Expand Down
8 changes: 4 additions & 4 deletions src/Twig/Extension/BreadcrumbsExtension.php
Expand Up @@ -56,7 +56,7 @@ public function getFunctions(): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use BreadcrumbsRuntime::renderBreadcrumbs() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use BreadcrumbsRuntime::renderBreadcrumbs() instead
*
* @param AdminInterface<object> $admin
*
Expand All @@ -69,7 +69,7 @@ public function renderBreadcrumbs(
string $action
): string {
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
BreadcrumbsRuntime::class,
Expand All @@ -82,7 +82,7 @@ public function renderBreadcrumbs(
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use BreadcrumbsRuntime::renderBreadcrumbsForTitle() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use BreadcrumbsRuntime::renderBreadcrumbsForTitle() instead
*
* @param AdminInterface<object> $admin
*
Expand All @@ -95,7 +95,7 @@ public function renderBreadcrumbsForTitle(
string $action
): string {
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
BreadcrumbsRuntime::class,
Expand Down
8 changes: 4 additions & 4 deletions src/Twig/Extension/CanonicalizeExtension.php
Expand Up @@ -48,15 +48,15 @@ public function getFunctions(): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use CanonicalizeRuntime::getCanonicalizedLocaleForMoment() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use CanonicalizeRuntime::getCanonicalizedLocaleForMoment() instead
*
* Returns a canonicalized locale for "moment" NPM library,
* or `null` if the locale's language is "en", which doesn't require localization.
*/
public function getCanonicalizedLocaleForMoment(): ?string
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
CanonicalizeRuntime::class,
Expand All @@ -69,15 +69,15 @@ public function getCanonicalizedLocaleForMoment(): ?string
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use CanonicalizeRuntime::getCanonicalizedLocaleForSelect2() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use CanonicalizeRuntime::getCanonicalizedLocaleForSelect2() instead
*
* Returns a canonicalized locale for "select2" NPM library,
* or `null` if the locale's language is "en", which doesn't require localization.
*/
public function getCanonicalizedLocaleForSelect2(): ?string
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
CanonicalizeRuntime::class,
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/Extension/GroupExtension.php
Expand Up @@ -50,7 +50,7 @@ public function getFunctions(): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use GroupRuntime::getDashboardGroupsWithCreatableAdmins() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use GroupRuntime::getDashboardGroupsWithCreatableAdmins() instead
*
* @phpstan-return array<array{
* label: string,
Expand All @@ -66,7 +66,7 @@ public function getFunctions(): array
public function getDashboardGroupsWithCreatableAdmins(): array
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
GroupRuntime::class,
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/Extension/IconExtension.php
Expand Up @@ -44,12 +44,12 @@ public function getFilters(): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use IconRuntime::parseIcon() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use IconRuntime::parseIcon() instead
*/
public function parseIcon(string $icon): string
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
IconRuntime::class,
Expand Down
16 changes: 8 additions & 8 deletions src/Twig/Extension/RenderElementExtension.php
Expand Up @@ -76,7 +76,7 @@ public function getFilters(): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use RenderElementRuntime::renderListElement() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use RenderElementRuntime::renderListElement() instead
*
* render a list element from the FieldDescription.
*
Expand All @@ -90,7 +90,7 @@ public function renderListElement(
array $params = []
): string {
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
RenderElementRuntime::class,
Expand All @@ -103,15 +103,15 @@ public function renderListElement(
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use RenderElementRuntime::renderViewElement() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use RenderElementRuntime::renderViewElement() instead
*/
public function renderViewElement(
Environment $environment,
FieldDescriptionInterface $fieldDescription,
object $object
): string {
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
RenderElementRuntime::class,
Expand All @@ -124,7 +124,7 @@ public function renderViewElement(
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use RenderElementRuntime::renderViewElementCompare() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use RenderElementRuntime::renderViewElementCompare() instead
*
* render a compared view element.
*
Expand All @@ -138,7 +138,7 @@ public function renderViewElementCompare(
$compareObject
): string {
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
RenderElementRuntime::class,
Expand All @@ -151,7 +151,7 @@ public function renderViewElementCompare(
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use RenderElementRuntime::renderRelationElement() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use RenderElementRuntime::renderRelationElement() instead
*
* @param mixed $element
*
Expand All @@ -162,7 +162,7 @@ public function renderViewElementCompare(
public function renderRelationElement($element, FieldDescriptionInterface $fieldDescription)
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
RenderElementRuntime::class,
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/Extension/SecurityExtension.php
Expand Up @@ -47,14 +47,14 @@ public function getFunctions(): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use SecurityRuntime::isGrantedAffirmative() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use SecurityRuntime::isGrantedAffirmative() instead
*
* @param string|string[] $role
*/
public function isGrantedAffirmative($role, ?object $object = null, ?string $field = null): bool
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
SecurityRuntime::class,
Expand Down
4 changes: 2 additions & 2 deletions src/Twig/Extension/SonataAdminExtension.php
Expand Up @@ -59,7 +59,7 @@ public function getName(): string
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/admin-bundle version 4.x use SonataAdminRuntime::getUrlSafeIdentifier() instead
* @deprecated since sonata-project/admin-bundle version 4.7 use SonataAdminRuntime::getUrlSafeIdentifier() instead
*
* Get the identifiers as a string that is safe to use in a url.
*
Expand All @@ -72,7 +72,7 @@ public function getName(): string
public function getUrlSafeIdentifier(object $model, ?AdminInterface $admin = null): ?string
{
@trigger_error(sprintf(
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.x and will be removed in 5.0.'
'The method "%s()" is deprecated since sonata-project/admin-bundle 4.7 and will be removed in 5.0.'
.' Use "%s::%s()" instead.',
__METHOD__,
SonataAdminRuntime::class,
Expand Down

0 comments on commit dc55fcb

Please sign in to comment.