Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AddressLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function search(array $search_param, array $geocoder_plugin_ids) :array {
return [];
}

$formatted_addr_list = array_map('self::reformat', iterator_to_array($addr_list));
$formatted_addr_list = array_map([static::class, 'reformat'], iterator_to_array($addr_list));

return $formatted_addr_list;
}
Expand Down
17 changes: 15 additions & 2 deletions src/Plugin/WebformElement/UKAddressLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,33 @@
class UKAddressLookup extends WebformCompositeBase {

/**
* Declares our properties.
* Declares and overrides properties.
*
* Configurable properties:
* Declares these configurable properties:
* - geocoder_plugins
* - always_display_manual_address_entry_btn.
*
* Overrides the `title_display` property. By default, composite elements
* keep their title invisible. We want it to be very much visible.
*
* @see Drupal\webform\Plugin\WebformElementBase::form()
*
* {@inheritdoc}
*/
protected function defineDefaultProperties() {

$parent_properties = parent::defineDefaultProperties();

$parent_properties['geocoder_plugins'] = [];
$parent_properties['always_display_manual_address_entry_btn'] = 'yes';

// We are trying to select the "Default" title display setting which results
// in a visible title. But the "Default" option uses an empty string as its
// key and providing an empty key here does nothing. As a work-around, we
// are using "default" which, while not among the available option keys,
// does the job perfectly.
$parent_properties['title_display'] = 'default';

return $parent_properties;
}

Expand Down