Deprecated function: Creation of dynamic property Drupal\radioactivity\Plugin\Field\FieldWidget\RadioactivityReferenceWidget::$elementInfo is deprecated

Created on 16 January 2024, 5 months ago
Updated 5 March 2024, 4 months ago

Problem/Motivation

Seeing Deprecation notice on form edit page where we have RadioactivityReferenceWidget on PHP 8.2.

Deprecated function: Creation of dynamic property Drupal\radioactivity\Plugin\Field\FieldWidget\RadioactivityReferenceWidget::$elementInfo is deprecated in Drupal\radioactivity\Plugin\Field\FieldWidget\RadioactivityReferenceWidget->__construct() (line 39 of modules/contrib/radioactivity/src/Plugin/Field/FieldWidget/RadioactivityReferenceWidget.php).

Drupal\radioactivity\Plugin\Field\FieldWidget\RadioactivityReferenceWidget->__construct('radioactivity_reference', Array, Object, Array, Array, Object) (Line: 46)
Drupal\radioactivity\Plugin\Field\FieldWidget\RadioactivityReferenceWidget::create(Object, Array, 'radioactivity_reference', Array) (Line: 122)
Drupal\Core\Field\WidgetPluginManager->createInstance('radioactivity_reference', Array) (Line: 110)
Drupal\Core\Field\WidgetPluginManager->getInstance(Array) (Line: 157)
Drupal\Core\Entity\Entity\EntityFormDisplay->getRenderer('field_radioactivity_count') (Line: 183)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('node_forum_edit_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)

Steps to reproduce

  1. Install Drupal 10.2.1 on PHP8.2
  2. Install radioactivity 4.0.x-dev
  3. Setup any kind of radioactivity reference field on articles
  4. Go to create content for articles
  5. Error message displays on top of page

Proposed resolution

1. Setup the protected property of $elementInfo in RadioactivityReferenceWidget.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

๐Ÿ› Bug report
Status

Needs review

Version

4.0

Component

Code

Created by

๐Ÿ‡น๐Ÿ‡ผTaiwan g-brodiei

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024