-
-
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
Add support for arrays containing additional database values in list views #6200
Merged
Conversation
This file contains 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
jorrit
force-pushed
the
additionalvalues
branch
4 times, most recently
from
July 14, 2020 11:47
06852ee
to
2e081cc
Compare
core23
previously requested changes
Jul 14, 2020
jorrit
force-pushed
the
additionalvalues
branch
4 times, most recently
from
July 15, 2020 07:48
29bf540
to
ff85e6a
Compare
VincentLanglet
requested changes
Jul 15, 2020
jorrit
force-pushed
the
additionalvalues
branch
3 times, most recently
from
July 15, 2020 09:30
a656cd9
to
fc3af36
Compare
VincentLanglet
previously approved these changes
Jul 15, 2020
phansys
requested changes
Jul 15, 2020
phansys
reviewed
Jul 15, 2020
jorrit
force-pushed
the
additionalvalues
branch
3 times, most recently
from
July 15, 2020 09:54
4519332
to
502d0ec
Compare
phansys
requested changes
Jul 15, 2020
jorrit
force-pushed
the
additionalvalues
branch
2 times, most recently
from
July 15, 2020 09:58
473d900
to
2a63ac2
Compare
phansys
requested changes
Jul 15, 2020
phansys
requested changes
Jul 15, 2020
phansys
requested changes
Jul 15, 2020
phansys
approved these changes
Jul 15, 2020
@core23 / @VincentLanglet Is there anything I can do to move this forward? |
VincentLanglet
approved these changes
Jul 24, 2020
I don't know… |
I find out it was |
I think we can merge this @greg0ire :) |
Thanks @jorrit ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Subject
I am trying to show additional fields in the list view. These fields are not part of the entity. Adding the field is no problem thanks to
configureQuery()
. However, Doctrine2 returns an array instead of an object when additional columns are present in the result set.This was discussed previously in sonata-project/SonataDoctrineORMAdminBundle#399 and sonata-project/SonataDoctrineORMAdminBundle#501 with no result. The direction in those issues was to use a DTO. This PR does not add support for DTO's but for the arrays that Doctrine2 returns.
As mentioned briefly in #6198 I found several issues with the method
SonataAdminExtension::getValueFromFieldDescription()
:if ($fieldDescription->getAssociationAdmin()) { ... }
is dysfunctional because it causes$value
to be a model instance instead of a field value. Apparently nobody has noticed.As such, I think it is best to leave this method alone for now and add functionality to
renderListElement()
.I am targeting this branch, because it is backwards compatible.
Changelog
To do