Allow to merge AjaxCommands inside of AjaxResponse

Created on 22 February 2023, almost 2 years ago

Problem/Motivation

We want to merge an AjaxResponse with another AjaxResponse and this currently not possible.

Inside of MediaLibraryWidget the code is returning an AjaxResponse.
Our code is also returning AjaxReponse and we wanted to merge them.

Merge request is provided.

If there is a better option please let me know.

Steps to reproduce

NA

Proposed resolution

Review merge request.
Added a setCommands function:

  public function setCommands($commands) {
    $this->commands = array_merge($this->commands, $commands);
  }

Remaining tasks

Review

Release notes snippet

Added setCommands function to AjaxResponse class to allow merging of AjaxResponses.

โœจ Feature request
Status

Needs review

Version

9.5

Component
Ajaxย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium mschudders

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024