Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

fix ltrim with left parts match #352

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gilles-g
Copy link
Member

No description provided.

@gilles-g gilles-g changed the title fix ltrim with left parts match' fix ltrim with left parts match Oct 21, 2021
@gilles-g
Copy link
Member Author

Hi @rtreffler-goldcore,

I open this PR in favor of the #314

We use a substr instead, I think we are good to merge

Thx for your feedback! it's really a silent bug that I had never encountered in 5 years: p

@rtreffler-goldcore
Copy link

Hi @rtreffler-goldcore,

I open this PR in favor of the #314

We use a substr instead, I think we are good to merge

Thx for your feedback! it's really a silent bug that I had never encountered in 5 years: p

thanks, I appreciate your quick action,
I believe that one is worth being ported for v5.* so people don't live on forks

@gilles-g
Copy link
Member Author

gilles-g commented Oct 21, 2021

I can 't maintain old release, because the code in the master branch has a big BC break with doctrine/dbal...

Maybe I could fix the v6., but v5. is too old

@rtreffler-goldcore
Copy link

I can 't maintain old release, because the code in the master branch has a big BC break with doctrine/dbal...

Maybe I could fix the v6., but v5. is too old

imho this change can be cherrypicked safely, this file exists and is almost the same (just different import for Doctrine's Type(s) - https://github.com/lexik/LexikFormFilterBundle/blob/v5.0.10/Event/Subscriber/DoctrineORMSubscriber.php)

I'm soon gonna have anther fix (I hope) for you in that file, so I would love to have it in v5.0.11 presumably.

@gilles-g
Copy link
Member Author

We don't have branches for each version, so I can't create a new tag from the master branch.

There is two solutions:

  1. migrate to the last version of the bundle (and update doctrime/orm and dbal in your project)
  2. or use an different alias in your dql

@rtreffler-goldcore
Copy link

We don't have branches for each version, so I can't create a new tag from the master branch.

There is two solutions:

  1. migrate to the last version of the bundle (and update doctrime/orm and dbal in your project)
  2. or use an different alias in your dql

Sorry if I'm too pushy, maybe my understanding is wrong here.
But can't you branch a release/5.0.11 from v5.0.10 tag, cherrypick the change and create a v5.0.11 tag from that point ?

Thanks for you patience with me and explanation.

@@ -78,7 +78,7 @@ public function filterEntity(GetFilterConditionEvent $event)

if ($dqlFrom = $event->getQueryBuilder()->getDQLPart('from')) {
$rootPart = reset($dqlFrom);
$fieldName = ltrim($event->getField(), $rootPart->getAlias() . '.');
$fieldName = substr($event->getField(), strlen($rootPart->getAlias.'.'));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$fieldName = substr($event->getField(), strlen($rootPart->getAlias.'.'));
$fieldName = substr($event->getField(), strlen($rootPart->getAlias().'.'));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants