backdrop-contrib / entity_plus

This module wraps in a variety of additional entity-related functionality from various sources. Partial port of D7 Entity API.
https://backdropcms.org/project/entity_plus
GNU General Public License v2.0
3 stars 11 forks source link

Getting value of empty date field through metadata wrapper throws Warnings #161

Closed argiepiano closed 1 year ago

argiepiano commented 1 year ago

Trying to get the value of an empty date field through a metadata wrapper throws Warning: Trying to access array offset on value of type null in entity_plus_metadata_date_struct_getter()

How to reproduce

  1. Add a date field to a node
  2. In a clean installation, enable Devel
  3. Run the following code:
$w = emw('node',2);
dpm($w->field_YOUR_FIELD->value());

The problem only happens in PHP 8.1 and higher. This was fixed in D7 Entity API.

argiepiano commented 1 year ago

This was actually fixed in #155! Time to do new release.