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

Issue fork rate-3396553

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rokkay created an issue. See original summary.

rokkay’s picture

shreya_th’s picture

Assigned: Unassigned » shreya_th

shreya_th’s picture

Assigned: shreya_th » Unassigned
viren18febs’s picture

Status: Active » Needs review

  • JordiK committed 394e7b94 on 3.0.x authored by rokkay
    Issue #3396553 by rokkay: ErrorException: Warning: Undefined array key "...
jordik’s picture

Status: Needs review » Fixed

Thank you for the patch! Committed to 3.0.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.