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.
Comment | File | Size | Author |
---|---|---|---|
#3 | fix_bundle_field_support-2818387-3.patch | 4.5 KB | agoradesign |
Comments
Comment #2
agoradesign CreditAttribution: agoradesign commentedComment #3
agoradesign CreditAttribution: agoradesign commentedreroll patch
Comment #5
PolThanks!
Comment #6
viappidu CreditAttribution: viappidu commentedPatch break configuration of geolocation fields. I posted on the issue there, bumping here.
Comment #7
agoradesign CreditAttribution: agoradesign commentedGeolocation has to adjust its code according to this change here, it's also only a matter of importing the wrong namespace
Comment #9
AjitSThank 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.