The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π¨π¦Canada nickdjm
So I've been debugging this in 9.5.10 and none of the patches above seem to identify the triggering element properly.
I tracked the issue down to the buttonWasClicked() method in FormBuilder. It specifically checks to see if the name and value of a button is found in the getUserInput() array, but buttons do not submit values. Their value is used as the text to display in the button, if if they are added to the getUserInput() array the value will be an empty string and never match to criteria for marking the button as clicked.
I also noticed that the key for any button on the form will only show up in the getUserInput() array if it was the button used to actually trigger the form submission.
I wrote a patch that adds another check to buttonWasClicked() that checks to see if a button's name is a key in the $input array, and if it is, it flags the button as the one that was clicked and results in the proper triggering element being flagged.
- π¨π¦Canada nickdjm
As a note: I know this needs some work, just wanted to get a patch posted to build upon.
- π¨π¦Canada nickdjm
I have updated the patch in 57 to fix an issue causing views apply/cancel/remove buttons to not submit properly.
The AJAX call _was_ adding a value to the "op" input, so the logic I had in 57 was flawed. We should only assume the input was clicked if the value matches exactly or if the value is exactly empty. Anything other than those 2 outcomes means we can't assume that button was clicked.
- π¨π¦Canada nickdjm
Further testing of both my patch and the previous patch has revealed that properly identifying the clicked button works in some scenarios, but not others.
In the case of my patch, it actually was breaking layout builder's submit buttons because they all have the same name- so disregard my patch.
- last update
7 months ago Custom Commands Failed