The D7 version had storage plugin support which was used to add access to PostGIS, and presumably could be used for other backends that had different storage requirements other than bytea. This is already indicated as a need in the D8 code base:

class GeofieldItem extends FieldItemBase {
...
    // @TODO: Backend plugins need to define requirement/settings methods,
    //   allow them to inject data here.

From whatr I can tell, this may have been due to a mis-named function (maybe a hold over from early D8 Field API?). Anyhow, the patch attached will at least allow the backend selection field to show up on the Storage configuration page -- however, the property "backend" is not being stored. Anyhow, this patch, if it is the right approach inches forward on this. This patch actually does two things:

  1. Rename "GeofieldItem::instanceSettingsForm()" to "GeofieldItem::storageSettingsForm()"
  2. Replace calls to "$field->settings" which is private to the public function "$field->getSettings"

Woulkd be interested in feedback on both.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robertwb created an issue. See original summary.

robertwb’s picture

Issue summary: View changes
robertwb’s picture

Title: GeoField No Seeing Backend Storage Plugins » GeoField Not Seeing Backend Storage Plugins
robertwb’s picture

heddn’s picture

Status: Active » Needs work
+++ b/src/Plugin/Field/FieldType/GeofieldItem.php
@@ -155,7 +155,7 @@ class GeofieldItem extends FieldItemBase {
-  public function instanceSettingsForm(array $form, FormStateInterface $form_state) {
+  public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) {

I think we need fieldSettingsForm and storageSettingsForm. The both of them. Or we should cleanup the default configuration in defaultFieldSettings and defaultStorageSettings.

Toilal’s picture

It seems on current Drupal 8 version (actually, i'm running 8.0.0-beta1), we only have to implement storageSettingsForm instead of fieldSettingsForm for custom backend to work properly. I have attached a patch.

itamair’s picture

Status: Needs work » Closed (outdated)