ErrorException: Warning: Undefined array key "entity_type"

Created on 25 October 2023, about 1 year ago
Updated 13 January 2024, 10 months ago

Problem/Motivation

Getting following error when adding widget to a view

ErrorException: Warning: Undefined array key "entity_type" in Drupal\rate\Plugin\views\field\RateWidgetField->buildOptionsForm() (linea 49 de /var/www/html/web/modules/contrib/rate/src/Plugin/views/field/RateWidgetField.php).

Drupal Version: 9.4.x
Rate Module version: 3.0.x
PHP: 8.0

Steps to reproduce

  • Install Drupal 9 site.
  • install Rate module with composer require 'drupal/rate:^3.0' command.
  • Go to a view
  • Add rate widget as field to view

Proposed resolution

Use isset() to validate if $field_name['entity_type'] was setted

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇪🇸Spain rokkay

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

Comments & Activities

Production build 0.71.5 2024