- Issue created by @Mschudders
- @mschudders opened merge request.
- Status changed to Needs work
over 1 year ago 1:52pm 22 February 2023 The Needs Review Queue Bot β tested this issue. It 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.
- π§π©Bangladesh eashika
enaznin β made their first commit to this issueβs fork.
- Status changed to Needs review
over 1 year ago 4:39am 27 February 2023 - Status changed to Needs work
over 1 year ago 6:15am 27 February 2023 - π«π·France nod_ Lille
There is an
addCommand
method that does much more than a simple array_merge so there is bound to be issues doing it this way.MR should be against 10.1.x since that is the current dev version
Naming of the new function is not ideal. It's not about setting commands, I'd be more of a
mergeCommands
method
At the moment commands can be added the addCommand method, so what the issue raised could be worked around @Mschudders would that be enough? - π§πͺBelgium Mschudders
@nod thanks for the information.
Indeed the naming was crappy.
Created a new branch against 10.1.x with the bot fixes + naming changes to the function.
Let me elaborate why this is usefull:
I have overridden
MediaLibraryWidget
so that I can attach an extra Ajax command to the callback of updateWidget:public static function updateWidget(array $form, FormStateInterface $form_state) { $response = parent::updateWidget($form, $form_state); $lb = new LayoutBuilderExtras(); $responseLbExtraLiveUpdates = $lb->blockAjaxSave($form, $form_state); $commandsLiveUpdate = $responseLbExtraLiveUpdates->getCommands(); $response->mergeCommands($commandsLiveUpdate); return $response; }
Since
updateWidget
returns an AjaxReponse already it isn't easy to add an additional command to it.
If you retrieve the commands from AjaxReponse it's already an rendered array and you cannot set them again. That's why I have added a mergeCommands function so that you can merge the commands.
I hope this clarifies things. - @mschudders opened merge request.
- First commit to issue fork.
- last update
about 1 year ago 29,420 pass - Status changed to Needs review
about 1 year ago 10:30am 9 June 2023 - Status changed to Needs work
about 1 year ago 7:25pm 9 June 2023 - πΊπΈUnited States smustgrave
Can the MR be updated for 11.x as that's the current development branch.
Also could use a simple test assertion to show it's working.
- last update
9 months ago 29,644 pass - last update
9 months ago 30,341 pass - Merge request !4902Issue #3343670: Allow to merge AjaxCommands inside of AjaxResponse β (Open) created by tim-diels
- last update
9 months ago 30,361 pass - π§πͺBelgium tim-diels Belgium π§πͺ
The module Layout Builder Extras - live update β requires this patch.
- First commit to issue fork.