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

Remove duplicate declaration of Views base table #3025

Merged
merged 1 commit into from
Dec 20, 2016

Conversation

pfrenssen
Copy link
Contributor

When a content entity is generated it currently shows up twice in the "Add view" wizard:

duplicate-entry

One of the two entries doesn't work correctly, when it is selected it is not possible to select any of the fields on the entity to use in the view.

I had a look and this appears to happen due to an additional base table being declared in MyEntityViewsData::getViewsData(). When I delete this section and simply use the default output from the parent class then it works as expected; core seems to handle it fine.

It's not clear to me why this additional base table was added. This was originally added in Issue #2358493: Integration with Views for entity content generated back in 2014 but I could not find a clear explanation of why it was necessary to declare an additional base table. I suppose it was working around a bug that was still present in the early days of D8 beta, but has since been resolved.

This now means that the entity MyEntityViewsData class is in fact no longer used / needed. I have put a placeholder text in it but maybe it is even a good idea to remove this file entirely?

@jmolivas jmolivas added this to the 1.0.0-rc12 milestone Dec 18, 2016
@pfrenssen
Copy link
Contributor Author

We should keep the MyEntityViewsData file. I tried if it was possible to remove it, but this will cause the entity to be hidden from Views.

@enzolutions
Copy link
Contributor

Thanks @pfrenssen for your contribution, works as expected.

@enzolutions enzolutions merged commit b4483c9 into hechoendrupal:master Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants