Allow setting only lat/lon field properties

Created on 22 December 2023, 6 months ago
Updated 23 December 2023, 6 months ago

Problem/Motivation

Currently when setting a field value programatically, you need to pass the value property. Just passing the lat/lon properties is not possible, even though the value property could easily be derived from those.

Example

// Works
$entity->set('field_user_group_location', [
    'value' => 'POINT (4.355714 50.855801)',
]);

// Doesn't work, but should
$entity->set('field_user_group_location', [
    'lat' => 50.855801000000,
    'lon' => 4.355714000000,
]);

Proposed resolution

Automatically transform coordinates to a point string in GeofieldItem::populateComputedValues().

✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇧🇪Belgium DieterHolvoet Brussels

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