Error using PHP 8.1:
Deprecated function: class_exists(): Passing null to parameter #1 ($class) of type string is deprecated in entityreference_get_selection_handler() (line 212 of [modules_path]/entityreference/entityreference.module).

Comments

tibezh created an issue. See original summary.

tibezh’s picture

Assigned: tibezh » Unassigned
Status: Active » Needs review
StatusFileSize
new573 bytes

Patch applied.

  • joseph.olstad committed 0b3d1560 on 7.x-1.x authored by tibezh
    Issue #3330366 by tibezh: PHP 8 Deprecated function: class_exists():...
joseph.olstad’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Tesam’s picture

PHP used 8.1.8
Need help and update/solution/patch:

Deprecated function: class_exists(): Passing null to parameter #1 ($class) of type string is deprecated in _entityreference_get_behavior_handler() (line 197 from /modules/entityreference/entityreference.module).

Code of file in that place:
190 function _entityreference_get_behavior_handler($behavior) {
191 $object_cache = drupal_static(__FUNCTION__);
192
193 if (!isset($object_cache[$behavior])) {
194 ctools_include('plugins');
195 $class = ctools_plugin_load_class('entityreference', 'behavior', $behavior, 'class');
196
197 $class = class_exists($class) ? $class : 'EntityReference_BehaviorHandler_Broken';
198 $object_cache[$behavior] = new $class($behavior);
199 }
200
201 return $object_cache[$behavior];
202 }

joseph.olstad’s picture

joseph.olstad’s picture