[geocoder_geofield] FieldItemList usage as a string

Created on 5 February 2024, 8 months ago
Updated 19 February 2024, 7 months ago

Problem/Motivation

Whenever user attempts to save a content with suitable geofield and Geocoder Geofield sub-module enabled it gives a WSOD

Steps to reproduce

- Enable Geocoder Geofield
- Provide geofield at node type
- Provide some value at the field and save a content

After investigation there been find out that at geocoder_field_entity_presave hook implementation script attempts to use a FieldItemList field instance as a string directly:
$default_values = $entity->get($field_name);
if (isset($geocoder['skip_not_empty_value']) && $geocoder['skip_not_empty_value'] && strlen($default_values) !== 0) {

Proposed solution is to use $default_values->getString()

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇺🇦Ukraine myLies

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

Comments & Activities

Production build 0.71.5 2024