Adding a relationship in Views to a custom plug (config entity) causes InvalidArgumentException

Created on 7 May 2024, about 2 months ago

Problem/Motivation

I have a created a custom relationship plugin to the "Webform" entity and found that caused an error and the view to not function as expected or bring in fields from the "Webform" entity.

Steps to reproduce

Create a view with a relationship to this custom plugin "Webform" e.g like to Media or User etc..

The error in the recent logs:

InvalidArgumentException: A valid cache entry key is required. Use getAll() to get all table data. in Drupal\views\ViewsData->get() (line 140 of /var/www/html/docroot/core/modules/views/src/ViewsData.php).

Not sure how to proceed or what I am doing wrong but heres my code for the custom plugin:

/**
 * Provides a group relation for users as members.
 *
 * @GroupRelationType(
 *   id = "webforms_group",
 *   label = @Translation("Webform"),
 *   description = @Translation("Adds webform to groups."),
 *   entity_type_id = "webform",
 *   config_entity_type = TRUE,
 *   pretty_path_key = "webform",
 *   reference_label = @Translation("Webforms Group"),
 *   reference_description = @Translation("The webforms you want to make part of this group.l"),
 *   enforced = TRUE,
 *   entity_access = TRUE,
 *   admin_permission = "administer webforms in groups",
 * )
 */
class WebformsGroup extends GroupRelationBase {
 // ...Normal code here
}
πŸ› Bug report
Status

Active

Version

3.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada phot0x

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

Comments & Activities

Production build 0.69.0 2024