-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
[console] Is lack of Views support a console issue or Drupal core issue? #3780
Comments
I am now undecided as to where the bugs are in this. I turns out my console created module has duplicates for View types. For my module i have 2 different custom entities and each lists twice when selecting the type of View. As it turns out one of the 2 has fields support and the other doesn't. A little more trial and error (the only way in D8).. and i can see this code in MyEntityViewsData.php
And, if i leave the file in place but remove the getViewsData, then my useless 2nd View type (with no field support) goes away. I have built a view (as best i could with the bugs in Views) using the view type which remains, and it seems to mostly work as expected. Still not sure if this is a bug in console but i'd guess not keeping up with Views changes. |
@liquidcms To make custom content entity visible for views we need to implement hook_views_data() - I will give it a try and then I will check other problems |
Part of this has gone away:
for some reason i ended up with new View types for each entity type created by Console. One is useless as it has no field support for Views, the other works fine. I manually removed some of the code written out by console to remove the bad one - and then it was good. But yes, first issue:
would be better if more functional (but easy to manually build once i found the right views type to use). |
Problem/Motivation
I am building a new contrib module which has some custom entities. I used console to put the start of this together. The entities seem to work fine, i have written 100s of lines of code for the functionality of my module using these entities and i am close to being finished. From initial console build i see that i automatically get pages to manage my entities, manage fields, etc.. very cool.
I see 2 major issues though:
My questions are not so much how to fix this.. but wondering where the disjoint is? Perhaps #1 is something Console could have added in? But, for #2 it seems like a core bug. Would Views not automatically know about fields in a custom entity? Or is this something that Console maybe should have added to the entity?
How to reproduce
Use console to make a custom entity.
Details to include:
The text was updated successfully, but these errors were encountered: