Skip to content
Snippets Groups Projects
Commit 04f2121f authored by catch's avatar catch
Browse files

Issue #3324726 by Akhil Babu, xjm, Gauravvv, joachim: #ajax 'options' property is undocumented

(cherry picked from commit 258cef9b)
parent 295a87f0
No related branches found
No related tags found
6 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!3603#ISSUE 3346218 Add a different message on edit comment,!3555Issue #2473873: Views entity operations lack cacheability support, resulting in incorrect dropbuttons
...@@ -2444,6 +2444,28 @@ function hook_validation_constraint_alter(array &$definitions) { ...@@ -2444,6 +2444,28 @@ function hook_validation_constraint_alter(array &$definitions) {
* autocomplete, as a \Symfony\Component\HttpFoundation\JsonResponse object. * autocomplete, as a \Symfony\Component\HttpFoundation\JsonResponse object.
* See the @link menu Routing topic @endlink for more information about * See the @link menu Routing topic @endlink for more information about
* routing. * routing.
*
* @section sec_query Query parameters in Ajax requests
* If a form uses an Ajax field, all the query parameters in the current request
* will be also added to the Ajax POST requests along with an additional
* 'ajax_form=1' parameter (See \Drupal\Core\Render\Element\RenderElement).
* @code
* $settings['options']['query'] += \Drupal::request()->query->all();
* $settings['options']['query'][FormBuilderInterface::AJAX_FORM_REQUEST] = TRUE;
* @endcode
*
* Form elements of type 'managed_file' will have an additional
* 'element_parents' query parameter in Ajax POST requests. This parameter will
* include the name of the element and its parents as per the render array.
* This helps to identify the position of the element in the form (See
* \Drupal\file\Element\ManagedFile).
* @code
* 'options' => [
* 'query' => [
* 'element_parents' => implode('/', $element['#array_parents']),
* ],
* ],
* @endcode
*/ */
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment