Problem/Motivation
I'm seeing the following warning:
Warning: Undefined array key "header" in Drupal\views_show_more\EventSubscriber\ShowMoreEventSubscriber->onResponse() (line 102 of /app/webroot/modules/contrib/views_show_more/src/EventSubscriber/ShowMoreEventSubscriber.php)
And then also the same for the footer key a few lines below.
So it's this line:
https://git.drupalcode.org/project/views_show_more/-/blob/2.x/src/EventS...
$attachments['drupalSettings']['header'] .= $this->renderer->renderPlain($header_render);
This needs to check to see if $attachments['drupalSettings']['header'] exists before using it.
Steps to reproduce
Have a view with attachments, and use the views load more module.
Proposed resolution
Add some checks for these array keys before using them.
Issue fork views_show_more-3444400
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
akhil_01 commentedComment #4
steven jones commentedFix for this added to the MR: https://git.drupalcode.org/project/views_show_more/-/merge_requests/8
Comment #6
ivnishThanks! Fixed