Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295818

PHP 8.1 ComputedItemListTrait::offsetExists deprecation

$
0
0

Problem/Motivation

When a class uses ComputedItemListTrait, a PHP 8.1 deprecation is trigger on offsetExists because return is not typed as bool.

Steps to reproduce

For example the profile module uses this trait in the class Drupal\profile\Plugin\Field\ProfileEntityFieldItemList. Displaying the login pane in a commerce checkout displays this error.

Proposed resolution

As for the others deprecated functions of this trait we could simply add #[\ReturnTypeWillChange] to suppress the deprecation.


Viewing all articles
Browse latest Browse all 295818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>