From dc55fcb624589da95149ce5fa807c2c42e2bc3b3 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Thu, 6 Jan 2022 01:04:31 +0100 Subject: [PATCH] 4.7.0 (#7699) * 4.7.0 * Update CHANGELOG.md Co-authored-by: Javier Spagnoletti * Update CHANGELOG.md Co-authored-by: Javier Spagnoletti * Update CHANGELOG.md Co-authored-by: Javier Spagnoletti * Update CHANGELOG.md Co-authored-by: Javier Spagnoletti * Update CHANGELOG.md Co-authored-by: Javier Spagnoletti * Update CHANGELOG.md Co-authored-by: Javier Spagnoletti Co-authored-by: Javier Spagnoletti --- CHANGELOG.md | 16 +++++++++++ src/Action/SetObjectFieldValueAction.php | 2 +- src/Admin/AbstractAdmin.php | 8 +++--- src/Admin/AdminInterface.php | 2 +- src/Admin/Pool.php | 2 +- src/Resources/config/twig.php | 28 +++++++++---------- src/Twig/Extension/BreadcrumbsExtension.php | 8 +++--- src/Twig/Extension/CanonicalizeExtension.php | 8 +++--- src/Twig/Extension/GroupExtension.php | 4 +-- src/Twig/Extension/IconExtension.php | 4 +-- src/Twig/Extension/RenderElementExtension.php | 16 +++++------ src/Twig/Extension/SecurityExtension.php | 4 +-- src/Twig/Extension/SonataAdminExtension.php | 4 +-- .../Extension/TemplateRegistryExtension.php | 8 +++--- src/Twig/Extension/XEditableExtension.php | 8 +++--- 15 files changed, 69 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3869c710bf..261ab2aaf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/Action/SetObjectFieldValueAction.php b/src/Action/SetObjectFieldValueAction.php index 2d5b7a0445..6bcd520394 100644 --- a/src/Action/SetObjectFieldValueAction.php +++ b/src/Action/SetObjectFieldValueAction.php @@ -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 diff --git a/src/Admin/AbstractAdmin.php b/src/Admin/AbstractAdmin.php index bd08424034..6a06e662a4 100644 --- a/src/Admin/AbstractAdmin.php +++ b/src/Admin/AbstractAdmin.php @@ -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); @@ -2197,7 +2197,7 @@ 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[] */ @@ -2205,7 +2205,7 @@ 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); diff --git a/src/Admin/AdminInterface.php b/src/Admin/AdminInterface.php index efe9dc9338..957306e03d 100644 --- a/src/Admin/AdminInterface.php +++ b/src/Admin/AdminInterface.php @@ -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; diff --git a/src/Admin/Pool.php b/src/Admin/Pool.php index 1ee0a937ce..47c7fa563a 100644 --- a/src/Admin/Pool.php +++ b/src/Admin/Pool.php @@ -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); diff --git a/src/Resources/config/twig.php b/src/Resources/config/twig.php index 5542da19b2..fc79fae196 100644 --- a/src/Resources/config/twig.php +++ b/src/Resources/config/twig.php @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/src/Twig/Extension/BreadcrumbsExtension.php b/src/Twig/Extension/BreadcrumbsExtension.php index b1ad8de7a5..9fa47e1de3 100644 --- a/src/Twig/Extension/BreadcrumbsExtension.php +++ b/src/Twig/Extension/BreadcrumbsExtension.php @@ -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 $admin * @@ -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, @@ -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 $admin * @@ -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, diff --git a/src/Twig/Extension/CanonicalizeExtension.php b/src/Twig/Extension/CanonicalizeExtension.php index 50f7cd03b2..4af5440ab9 100644 --- a/src/Twig/Extension/CanonicalizeExtension.php +++ b/src/Twig/Extension/CanonicalizeExtension.php @@ -48,7 +48,7 @@ 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. @@ -56,7 +56,7 @@ public function getFunctions(): array 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, @@ -69,7 +69,7 @@ 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. @@ -77,7 +77,7 @@ public function getCanonicalizedLocaleForMoment(): ?string 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, diff --git a/src/Twig/Extension/GroupExtension.php b/src/Twig/Extension/GroupExtension.php index 853bf76073..68fe6a2a2c 100644 --- a/src/Twig/Extension/GroupExtension.php +++ b/src/Twig/Extension/GroupExtension.php @@ -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