-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BC after drop twig/extensions #6145
Fix BC after drop twig/extensions #6145
Conversation
0fb5608
to
79d3cbd
Compare
@VincentLanglet Can you check this is working for you? Also better add next parameter like here or |
I forgot... Where did we talk about this issue ?
Changelog is always needed when you fix something. |
Even if it not possible to install in stable? It is little strange, something like say: hey i fix unexisting bug. You can find here: |
In this PR, you
The more verbose are commit, Pr, Changelog, Upgrade note, the more this project will be easy to maintain.
Then how do you want that I test this ? |
bcd10b2
to
3c57f96
Compare
3c57f96
to
5587412
Compare
@core23 @VincentLanglet @jordisala1991 RTM. Can you check it? |
5587412
to
bc82182
Compare
bc82182
to
2161e4d
Compare
2161e4d
to
733c89a
Compare
@VincentLanglet @jordisala1991 @core23 @greg0ire
After that i can rebase #5461 |
@@ -29,18 +29,28 @@ | |||
* @internal | |||
* | |||
* @see https://github.com/symfony/symfony/pull/35649 | |||
* @deprecated since sonata-project/admin-bundle 3.69, to be removed in 4.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should usually use sonata-project/admin-bundle 3.x
because you can't be sure that he release will not be created before this merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but https://github.com/sonata-project/SonataAdminBundle/pull/6145/files/733c89a78260f6cfa810a2d9d8d34bb2564a7383#diff-b96bf7cefcf2cc23077357469e7d42cbR23 ( * NEXT_MAJOR: Remove this class.
) was add in 3.69, so in this case it should be OK.
edca82a
to
eef1af1
Compare
This commit replace using TextExtension from `twig/extensions` by copy truncate function to `DeprecatedTextExtension` method. Update src/DependencyInjection/Configuration.php Co-authored-by: Vincent Langlet <[email protected]>
eef1af1
to
a94e623
Compare
@VincentLanglet Can we merge it? Ask becouse #6140 (comment) |
I see no reason for not merging this. :) |
@@ -176,6 +170,7 @@ public function getConfigTreeBuilder() | |||
// NEXT_MAJOR : remove this option | |||
->booleanNode('legacy_twig_text_extension') | |||
->info('Use text filters from "twig/extensions" instead of those provided by "twig/string-extra".') | |||
->setDeprecated('The child node "%node%" at path "%path%" is deprecated since sonata-project/admin-bundle 3.x and will be remove in 4.0.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->setDeprecated('The child node "%node%" at path "%path%" is deprecated since sonata-project/admin-bundle 3.x and will be remove in 4.0.') | |
->setDeprecated('The child node "%node%" at path "%path%" is deprecated since sonata-project/admin-bundle 3.x and will be removed in version 4.0.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think version
is unnecessary here.
'Using `true` as value for "sonata_admin.options.legacy_twig_text_extension" option is deprecated since sonata-project/admin-bundle 3.64 and will be remove in 4.0'. | ||
'You should set it to `false` before upgrade process.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Using `true` as value for "sonata_admin.options.legacy_twig_text_extension" option is deprecated since sonata-project/admin-bundle 3.64 and will be remove in 4.0'. | |
'You should set it to `false` before upgrade process.' | |
'Using `true` as value for "sonata_admin.options.legacy_twig_text_extension" option is deprecated since sonata-project/admin-bundle 3.64 and will be removed in version 4.0.'. | |
' Remove it or set its value to `false`.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first it should be set to flase, then can be delete in upgrade process becouse by default is it true. Remove it is bad idea
*/ | ||
final class DeprecatedTextExtension extends AbstractExtension | ||
{ | ||
public function twigTruncateFilter(Environment $env, ?string $value, int $length = 30, bool $preserve = false, $separator = '...') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function twigTruncateFilter(Environment $env, ?string $value, int $length = 30, bool $preserve = false, $separator = '...') | |
public function twigTruncateFilter(Environment $env, ?string $value, int $length = 30, bool $preserve = false, $separator = '...'): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
@wbloszyk, I've left some suggestions just after the PR was merged. Please, take a look. |
@phansys Thanks for suggestions. I think this should be change in some bigger |
There is a deprecation, this is minor. |
Subject
This issue resolve problem with missing TextExtension after drop CoreBundle and upgrate sonata-project/twig-extensions to 1.x when
sonata_admin.options.legacy_twig_text_extension
is set to true. It is resolve by copy truncate function to newDeprecatedTextExtension
class.I am targeting this branch, because this change repsect BC.
Changelog