public function GeofieldWidget::fileCallback in farmOS 2.x
AJAX callback for the find using files field button.
Parameters
array $form: The form.
\Drupal\Core\Form\FormStateInterface $form_state: The form state.
Return value
array|mixed|null The map form element to replace
File
- modules/
core/ map/ src/ Plugin/ Field/ FieldWidget/ GeofieldWidget.php, line 306
Class
- GeofieldWidget
- Plugin implementation of the map 'geofield' widget.
Namespace
Drupal\farm_map\Plugin\Field\FieldWidgetCode
public function fileCallback(array &$form, FormStateInterface $form_state) {
// Return the rebuilt map form field field element.
$triggering_element = $form_state
->getTriggeringElement();
return NestedArray::getValue($form, array_slice($triggering_element['#array_parents'], 0, -1));
}