Skip to content

11783 failure with indexed relation#11792

Merged
greg0ire merged 1 commit intodoctrine:2.20.xfrom
dbannik:11783-failure-with-indexed-relation
Jan 28, 2025
Merged

11783 failure with indexed relation#11792
greg0ire merged 1 commit intodoctrine:2.20.xfrom
dbannik:11783-failure-with-indexed-relation

Conversation

@dbannik
Copy link
Copy Markdown
Contributor

@dbannik dbannik commented Jan 17, 2025

Fix issue #11783

@greg0ire
Copy link
Copy Markdown
Member

Also, please squash the commits together (since you wouldn't revert one without the others, right?), and improve the remaining commit message according to the contributing guide. Specifically, explain both the bug and the fix.

@dbannik dbannik force-pushed the 11783-failure-with-indexed-relation branch from b0766d6 to 43d33aa Compare January 17, 2025 09:09
@dbannik
Copy link
Copy Markdown
Contributor Author

dbannik commented Jan 17, 2025

Also, please squash the commits together (since you wouldn't revert one without the others, right?), and improve the remaining commit message according to the contributing guide. Specifically, explain both the bug and the fix.

done

@dbannik
Copy link
Copy Markdown
Contributor Author

dbannik commented Jan 17, 2025

@greg0ire The problem with phpstan checking still exists, it should be fixed in a separate commit

@greg0ire
Copy link
Copy Markdown
Member

See #11793

@dbannik dbannik force-pushed the 11783-failure-with-indexed-relation branch from 43d33aa to 47a3015 Compare January 19, 2025 19:14
@dbannik
Copy link
Copy Markdown
Contributor Author

dbannik commented Jan 19, 2025

See #11793

Rebased PR

@dbannik dbannik requested a review from greg0ire January 19, 2025 19:29
@greg0ire greg0ire added the Bug label Jan 20, 2025
@greg0ire
Copy link
Copy Markdown
Member

The bug related (#11694) and fixed mapping of sql column alias to field in entity (#11783) and
invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes

if you are doing 2 things in one commit, that's bad. You should be doing 2 commits with clear messages, so that if one of them is wrong, it can be understood and reverted while the other stays.

@dbannik dbannik force-pushed the 11783-failure-with-indexed-relation branch from 47a3015 to 2b62d35 Compare January 21, 2025 14:03
@dbannik
Copy link
Copy Markdown
Contributor Author

dbannik commented Jan 21, 2025

The bug related (#11694) and fixed mapping of sql column alias to field in entity (#11783) and
invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes

if you are doing 2 things in one commit, that's bad. You should be doing 2 commits with clear messages, so that if one of them is wrong, it can be understood and reverted while the other stays.

these 2 things can't be separated
since separately the tests will fail

greg0ire
greg0ire previously approved these changes Jan 21, 2025
* @return CollectionCacheKey
*/
protected function buildCollectionCacheKey(array $association, $ownerId)
protected function buildCollectionCacheKey(array $association, $ownerId, string $filterHash)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@greg0ire Is introducing a new argument to a protected method okay in a version-branch that's already released? It may break projects that are implementing the Abstract class.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I didn't spot that one. You're right, it's a breaking change for extending classes, that suddenly need to have that extra argument, and for callers, that need to provide it.

@dbannik please resort to func_get_args(). The new argument should be added in the next major release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@greg0ire instead of func_get_args can we use default value ?

Suggested change
protected function buildCollectionCacheKey(array $association, $ownerId, string $filterHash)
protected function buildCollectionCacheKey(array $association, $ownerId, string $filterHash = '')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That would still be a breaking change for extending classes (they would suddenly have incompatible signatures).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

resolved

The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
@dbannik dbannik force-pushed the 11783-failure-with-indexed-relation branch from 2b62d35 to 6755bb0 Compare January 27, 2025 12:36
@greg0ire greg0ire added this to the 2.20.2 milestone Jan 28, 2025
@greg0ire greg0ire merged commit 9e999ea into doctrine:2.20.x Jan 28, 2025
74 checks passed
@greg0ire
Copy link
Copy Markdown
Member

Thanks @dbannik !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants