Hi,

It would be great if geocoder_field didn't add third party settings to fields it wasn't configured to do anything on (ie when geocoding method is set to none). Especially now that #2842272: Use #states to hide geocoder field settings when not geocoding anything has been merged in.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AndyF created an issue. See original summary.

AndyF’s picture

Status: Active » Needs review
FileSize
1.02 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Nice! Do you think it would be worth writing a test for that?

Pol’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Hello,

What is the status of this patch ? Is it still valid ?

Thanks.

dww’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community
FileSize
999 bytes

Definitely still valid.

However, patch #2 doesn't apply cleanly to the end of the 8.x-2.x branch, so here's a trivial re-roll.

Before the patch, here's an example config from a test site for a field that has nothing to do with addresses or geocoding:

langcode: en
status: true
dependencies:
  config:
    - field.storage.node.field_summary
    - node.type.layout_page
  module:
    - geocoder_field
    - text
third_party_settings:
  geocoder_field:
    method: none
    field: title
    plugins: {  }
    dumper: wkt
    delta_handling: default
    failure:
      handling: preserve
      status_message: true
      log: true
id: node.layout_page.field_summary
field_name: field_summary
entity_type: node
bundle: layout_page
label: Summary
description: 'One or two sentence summary of this page, for example to use when sharing to social media.'
required: false
translatable: false
default_value: {  }
default_value_callback: ''
settings: {  }
field_type: text_long

Notice all the cruft about geocoder_field? Both in third_party_settings, and also the fact the field config now *depends* on geocoder_field (even though it's not related to geocoder at all!).

After applying the patch and re-saving the field settings, the config export now looks like this:

langcode: en
status: true
dependencies:
  config:
    - field.storage.node.field_summary
    - node.type.layout_page
  module:
    - text
id: node.layout_page.field_summary
field_name: field_summary
entity_type: node
bundle: layout_page
label: Summary
description: 'One or two sentence summary of this page, for example to use when sharing to social media.'
required: false
translatable: false
default_value: {  }
default_value_callback: ''
settings: {  }
field_type: text_long

MUCH better! No bogus dependency, and no ignored third_party_settings related to functionality this field has nothing to do with.

dww’s picture

p.s. By default, d.o's 'Git command' is now using me as the author. Please don't. This is @AndyF's code and they should get credited as the patch author, not me.

  • itamair committed 880d896 on 8.x-2.x authored by AndyF
    Issue #2884928 by AndyF, dww: Don't add third party settings when...
itamair’s picture

I just tested ... and indeed still make sense. Tnx. Just committed in the last dev.

itamair’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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