Problem/Motivation
In ManagedFile, the ajax does this:
'options' => [
'query' => [
'element_parents' => implode('/', $element['#array_parents']),
],
],
This allows query parameters to be passed in the AJAX request.
In this particular case, it allows the AJAX callback to receive the #array_parents. These are what allows the callback to know where it is situated in the form, and so how to get the form element being operated on. It's essential for using AJAX in form elements (as opposed to complete forms).
However, it's not documented in core.api.php's section on AJAX.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #5
akhil babuFor reviews and corrections.
Comment #7
java008 commentedI reviewed this MR and it looks good. Moving to RTBC.
Comment #8
java008 commentedComment #9
feuerwagenThis still needs work. Seems like the formatting of the added docs doesn't follow the Drupal standards:
Comment #11
gauravvvv commentedComment #12
akhil babuThanks @Gauravvv.
Composer error seems like a common issue: https://drupal.slack.com/archives/C51GNJG91/p1673357627190639
Comment #13
sharayurajput commentedI will review it
Comment #14
sharayurajput commentedReviewed the MR its looking good We can move this to RTBC
Comment #15
xjmThe tests are failing, so the issue can't be RTBC. The test failures are due to an existing issue with our testing infrastructure, but once that is resolved, we need a clean test run here to proceed.
Comment #16
xjmI verified that the coding standards checks will pass by applying the patch locally and running:
However, when I applied the patch locally, I found a number of code style errors, like formatting that did not match other sections of the doc and lines not wrapping at 80 characters. Since MRs are having testing issues today, I've suppled the above MR as a patch, with an interdiff showing my changes.
What I haven't done is do the research on the API to confirm the accuracy of the documentation. That's a task a credit-worthy code review could do.
Thanks!
Comment #17
xjmAlso maybe the parenthetical
See...would be better as@see, or at least added as@seeat the end of the section?Comment #18
xjmI also pushed my change from #16 to the MR, in the hopes that we can go back to using the MR once this Composer issue on DrupalCI is resolved.
Comment #20
smustgrave commentedRemoving credit from myself. But I rebased the MR to jerk it loose so it will run.
Comment #24
catchCommitted 258cef9 and pushed to 10.1.x. Thanks! Also cherry-picked to 10.0.x and 9.5.x