Skip to content
Snippets Groups Projects
Verified Commit af7f5ed2 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3441920 by scott_euser, catch, smustgrave, quietone: Support #attached...

Issue #3441920 by scott_euser, catch, smustgrave, quietone: Support #attached settings in ViewAjaxController

(cherry picked from commit 3e486f78)
parent c27ea217
No related branches found
No related tags found
6 merge requests!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!8325Update file Sort.php,!8095Expose document root on install
Pipeline #165068 passed
Pipeline: drupal

#165087

    Pipeline: drupal

    #165084

      Pipeline: drupal

      #165078

        +1
        ......@@ -214,6 +214,10 @@ public function ajaxView(Request $request) {
        $response->addCommand(new PrependCommand(".js-view-dom-id-$dom_id", ['#type' => 'status_messages']));
        $request->query->set('ajax_page_state', $existing_page_state);
        if (!empty($preview['#attached'])) {
        $response->setAttachments($preview['#attached']);
        }
        return $response;
        }
        else {
        ......
        ......@@ -209,6 +209,14 @@ public function testAjaxView() {
        $this->assertSame($response->getView(), $executable);
        $this->assertViewResultCommand($response);
        // Test that the ajax controller for Views contains the
        // Drupal Settings.
        $this->assertEquals([
        'drupalSettings' => [
        'testSetting' => ['Setting'],
        ],
        ], $response->getAttachments());
        }
        /**
        ......@@ -389,7 +397,14 @@ protected function setupValidMocks($use_ajax = self::USE_AJAX) {
        ->willReturn(TRUE);
        $executable->expects($this->atMost(1))
        ->method('preview')
        ->willReturn(['#markup' => 'View result']);
        ->willReturn([
        '#markup' => 'View result',
        '#attached' => [
        'drupalSettings' => [
        'testSetting' => ['Setting'],
        ],
        ],
        ]);
        $this->executableFactory->expects($this->once())
        ->method('get')
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment