Date on a relationship entity

Created on 16 October 2025, 2 days ago

Problem/Motivation

In evaluating the module with a view that has the date loaded on a relationship entity, rather than the 'event' entity itself, it causes a fatal error as the code tries to load this field from the base entity:

InvalidArgumentException: Field field_when_1 is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 617 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Drupal\Core\Entity\ContentEntityBase->get() (Line: 481)
Drupal\views_ical\Plugin\views\row\IcalFieldsWizard->addSmartDateEvent() (Line: 119)

Looking at the code https://git.drupalcode.org/project/views_ical/-/blob/8.x-1.x/src/Plugin/...

    $entity = $this->getEntity($row);
    $datefieldValues = $entity->get($fieldMapping['date_field'])->getValue();

I understand it's loading https://git.drupalcode.org/project/views_ical/-/blob/8.x-1.x/src/Plugin/... the base entity and trying to access the field name on it. Where as this is on one of the _relationship entities. The code also does this for the DateTime field type.

Steps to reproduce

Create a content type, and view, add a relationship to another content type with the date on it, add a relationship in the view, use the date field from the relationship entity for the DTSTART.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands ekes

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.

No activities found.

Production build 0.71.5 2024