Content overwritten with empty output

Created on 15 May 2023, over 1 year ago
Updated 6 July 2023, over 1 year ago

Problem/Motivation

Core's views module attaches two insert command, one of them is "prepend" that causes empty text overwriting the output if the prepend is replaced by viewsShowMore.

ViewAjaxController::ajaxView 
        $response->addCommand(new ReplaceCommand(".js-view-dom-id-$dom_id", $preview));
        $response->addCommand(new PrependCommand(".js-view-dom-id-$dom_id", ['#type' => 'status_messages']));

This causes contents are missing after click the view show more button.

Steps to reproduce

Just regular view with more than two pages contents output.

Proposed resolution

Update ShowMoreEventSubscriber:
if ($command['command'] == 'insert' && $command['method'] == 'replaceWith')
.Probably not the best solution but additional defensive code to make it more robust.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024