This repository was archived by the owner on Aug 1, 2024. It is now read-only.
Open
Conversation
Author
|
TBH I can't see how to test this, based on the current tests 😕 |
The bundle assumed surrogate keys, and returned `Type::INTEGER` for all. This change uses class metadata to get the correct type.
Author
|
An update: we've been using this in production for nearly 3 years and it works great. If readers want to use the branch, update your composer.json to the following: {
"require": {
"lexik/form-filter-bundle": "dev-natural-keys"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/pbowyer/LexikFormFilterBundle"
}
],
}Preferably fork my repository first, so any changes I make you can review first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
The bundle assumes that relations are surrogate keys, and they are always of
Type::INTEGER.What?
This change uses class metadata to get the correct type for the identifier. Now keys of
Type::STRING(and others) will work.Notes
This is the result of a morning's debugging, working out why specific filters weren't working. It is submitted for discussion and to see if there's a better approach. It's not yet suitable to merge as there are no tests written.