Skip to content
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

Exclude relations from Content::toArray() #1927

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

I-Valchev
Copy link
Member

Fixes #1900

Right now there's ways to get relations both in code (using the repository) or in twig using the various filters.

I'm not sure that's the most desirable way to go, but as @simongroenewolt points out it's better to not have them than return something wrong.

Copy link
Contributor

@simongroenewolt simongroenewolt left a comment

Choose a reason for hiding this comment

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

I had a look at the code and agree that leaving them out is a better solution than trying to include the relations. Including them looks hard from this place in the code.

@I-Valchev
Copy link
Member Author

@simongroenewolt you are right, it is difficult because we cannot use autowiring in entities. So at best a solution will be patchy.

Good news is, we have ways to retrieve them both programatically and from the templates, so hopefully no harm done :-)

Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

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

Agreed, let's roll with this for now. ^_^

@bobdenotter bobdenotter merged commit 3d8b379 into master Oct 1, 2020
@bobdenotter bobdenotter deleted the bugfix/exclude-relations-from-content-array branch October 1, 2020 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content->toArray() always returns [] for relations.
3 participants