Notice: Undefined index: target_type/target_id in views

Created on 8 October 2017, over 6 years ago
Updated 20 December 2023, 6 months ago

Notice: Undefined index: target_type in /var/www/drupalvm/drupal/web/modules/contrib/dynamic_entity_reference/dynamic_entity_reference.views.inc on line 148
PHP Notice: Undefined index: target_id in /var/www/drupalvm/drupal/web/modules/contrib/dynamic_entity_reference/dynamic_entity_reference.views.inc on line 14
7

I get 12 of these in my console whenever I clear my cache. My first thought is that it might be related to the fact that I am working on a computed dynamic entity reference field list that creates items and sets these values via the line:

$this->list[$index] = $this->createItem($index, [
	'target_id' => $reference['referring_entity_id'],
	'target_type' => $reference['referring_entity_type']
]);

I think this is because dynamic_entity_reference_views_data does not check if the dynamic entity reference field was computed or not. So it queries for a table column that does not exist.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada GeraldNDA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024