Hey there,
I've created a geofield as base field of an entity type and tried to use it in combination with address and geocoder_field. It didn't work as expected. I then saw the restriction on configurable fields (FieldConfigInterface) in the code, which makes sense, because you need third party settings. That's why you can't use base fields, that's clear.

I did the trick to implement hook_entity_bundle_field_info() and defined a BaseFieldOverride there - these fields are configurable and therefore should work. But again, it failed.

I then saw, that the code checks for instanceof \Drupal\field\FieldConfigInterface, which is the wrong check. The \Drupal\Core\Field\FieldConfigInterface is the one you probably wanted. This also has the third party settings and is used by both bundle fields and "normal" fields. The other FieldConfigInterface is rather empty and not that important, and it would exclude the bundle fields.

I'll attach a patch. Sorry to not have time to demonstrate the bundle field failing in a test.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agoradesign created an issue. See original summary.

agoradesign’s picture

Status: Active » Needs review
FileSize
4.56 KB
agoradesign’s picture

FileSize
4.5 KB

reroll patch

  • Pol committed 3ff3077 on 8.x-2.x authored by agoradesign
    Issue #2818387 by agoradesign: Wrong FieldConfigInterface is used,...
Pol’s picture

Status: Needs review » Fixed

Thanks!

viappidu’s picture

Patch break configuration of geolocation fields. I posted on the issue there, bumping here.

agoradesign’s picture

Geolocation has to adjust its code according to this change here, it's also only a matter of importing the wrong namespace

Status: Fixed » Closed (fixed)

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

AjitS’s picture

Thank you for all the work everyone! Geolocation has adjusted the code there. There just needs to be a new release created so that this becomes usable without the patch.