Problem
Critical bug during view creation process
Notice: Undefined index: entity_type in Drupal\views\Plugin\views\field\EntityField->getFieldStorageDefinition() (line 325 of /var/www/drupalvm/drupal/web/core/modules/views/src/Plugin/views/field/EntityField.php) #0 /var/www/drupalvm/drupal/web/core/includes/bootstrap.inc(566): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/drupal...', 325, Array) #1 /var/www/drupalvm/drupal/web/core/modules/views/src/Plugin/views/field/EntityField.php(325): _drupal_error_handler(8,
...Proposed resolution
Replaced Field wich extends EntityField with FieldPluginBase (EntityField assumes its working on an entity wich is not necessarily the case here)
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | data-fix_views-2934560-13.patch | 669 bytes | andriyun |
Comments
Comment #2
josebc commentedThis patch fixed it for me, replaced Field with FieldPluginBase (taken from watchdog module)
Comment #3
josebc commentedBetter patch to make views actually work with filters and arguments
Comment #4
joachim commentedPatch has a lot of changes -- can you explain them a bit please? Eg some views handlers are being removed, etc.
I haven't looked at this module in years, so small simple patches have a much better chance of getting committed. Complex patches like this one that make me thing 'oh holy crap I've no idea what this is changing, it might kill kittens' will probably get left until another user reviews them, which could be months / years.
Comment #5
josebc commentedI get your point, maybe we should split this into 2 separate issues
To make thing more clear:
The first patch had the line that fixes the "Notice: Undefined index: entity_type" replacing Field wich extends EntityField with FieldPluginBase (EntityField assumes its working on an entity wich is not necessarily the case here).
The second part is basically removing the d7 code (wich was not actually doing anything) and replacing it with a small function that maps fields to views plugins provided by core depending on the field type.
the views integration part still need work since we have completely missing parts (eg. joins or relations between tables), I would gladly work on the remaining issues however im not that familiar with the roadmap for this module, any help with that is appreciated
Comment #6
joachim commented> im not that familiar with the roadmap for this module
There's no roadmap :)
I've not used this since D7. @valthebald asked me for co-maintainer access about a year ago, and has made a start on the D8 port, but hasn't been active in some time. You could ask him what if he has plans for it still.
If not, then the roadmap is what you & any other contributors find useful -- feel free to start an issue for that.
Comment #7
josebc commentedLooks like there is not much activity on the module ATM, Ill keep opening issues and adding to https://www.drupal.org/project/data/issues/2259927
For this issue lets keep the first patch to fix the error , the part regarding fields will be patched here https://www.drupal.org/project/data/issues/2941967
Comment #8
josebc commentedComment #9
andriyun commentedComment #10
andriyun commentedPatch https://www.drupal.org/project/data/issues/2934560#comment-12457291
Works perfect for me.
Notice is gone and all columns from data table are able to be add for view.
Comment #11
andriyun commentedThis issue is not actual anymore.
Subject piece of code was updated in scope of #3088972: Drupal 9 plan
Comment #12
andriyun commentedNo, sorry it might still make sense :-D
Patch at least need reroll
Comment #13
andriyun commentedRerolled patch