views data doesn't work with bundle fields and produces a warning

Created on 11 November 2024, 5 months ago

Problem/Motivation

viewsDataAlter() doesn't work with bundle fields, probably because it's expecting non-config fields to have views data already declared by core, and core doesn't do this for bundle fields -- 🐛 [PP-1] bundleFieldDefinitions() are not added in EntityViewsData Needs work .

This produces a warning:

        if ($tableMapping->requiresDedicatedTableStorage($fieldStorage)) {
          $fieldTable = $tableMapping->getDedicatedDataTableName($fieldStorage);
          $fieldData = &$data[$fieldTable];

> Warning: foreach() argument must be of type array|object, null given in Drupal\date_recur\DateRecurViewsHooks->viewsDataAlter() (line 193 of modules/contrib/date_recur/src/DateRecurViewsHooks.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Checklist ✔

[[Remove this:] Replace ❌ with ✔ where applicable]

  • [ ❌ ] Changeset meets coding standards and project style guide .
  • [ ❌ ] Changeset has tests
  • [ ❌ ] Proposal has been discussed externally (Slack/IRC)
🐛 Bug report
Status

Active

Version

3.9

Component

Views

Created by

🇬🇧United Kingdom joachim

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024