Problem/Motivation

Currently geocoder uses a custom approach for handling visibility of dependent fields. Other modules cannot easily modify or extend the visibility settings, e.g., to set an additional visibility condition.

Proposed resolution

Convert the code to use the standard Drupal 7 #states system.

Remaining tasks

Comments

phayes’s picture

I'm not familiar with the new #states system nedjo. I'll give it a shot, but if you have a patch up your sleeve... :-)

~Patrick

plopesc’s picture

Status: Active » Needs review
StatusFileSize
new4.88 KB

Patch attached

now it could work with '#states'

Regards

phayes’s picture

Status: Needs review » Fixed

Commited. Thanks Nedjo

phayes’s picture

Errrr, I meant, "Thanks plopesc"

phayes’s picture

Errrr, I meant, "Thanks plopesc"

nedjo’s picture

Status: Fixed » Needs review
StatusFileSize
new3.9 KB

Dependent fields aren't being updated after geocoder_handler changes. Attached patch triggers .change() to fix this.

Also tweaks the admin js to more closely follow Drupal js conventions:

  • Use .once() when applying behaviour.
  • Use :input selector rather than # to be AJAX safe (IDs may change).
  • Attach using .change() rather than onupdate.
phayes’s picture

Status: Needs review » Fixed

committed. Thanks.

Status: Fixed » Closed (fixed)

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