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)

Comments

lquessenberry created an issue. See original summary.

josebc’s picture

Status: Active » Needs review
StatusFileSize
new967 bytes

This patch fixed it for me, replaced Field with FieldPluginBase (taken from watchdog module)

josebc’s picture

StatusFileSize
new9.87 KB

Better patch to make views actually work with filters and arguments

joachim’s picture

Issue tags: -views, -error, -undefined index

Patch 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.

josebc’s picture

I 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

joachim’s picture

> 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.

josebc’s picture

Looks 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

josebc’s picture

andriyun’s picture

Title: Views Not Working At All » [Views integration] Undefined index: entity_type
Issue summary: View changes
andriyun’s picture

Status: Needs review » Reviewed & tested by the community

Patch 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.

andriyun’s picture

Status: Reviewed & tested by the community » Closed (outdated)

This issue is not actual anymore.
Subject piece of code was updated in scope of #3088972: Drupal 9 plan

andriyun’s picture

Status: Closed (outdated) » Needs work
Issue tags: +Needs reroll
Related issues: +#3088972: Drupal 9 plan

No, sorry it might still make sense :-D
Patch at least need reroll

andriyun’s picture

Status: Needs work » Needs review
StatusFileSize
new669 bytes

Rerolled patch