Problem

When you creat a block field for a view. This block is triggering notices when the view had no output:

Notice: Undefined index: #title in Drupal\ds\Plugin\DsField\DynamicBlockField->getTitle() (line 57 of /x/www/modules/contrib/ds/src/Plugin/DsField/DynamicBlockField.php).

This is because views is doing this:

      // When view_build is empty, the actual render array output for this View
      // is going to be empty. In that case, return just #cache, so that the
      // render system knows the reasons (cache contexts & tags) why this Views
      // block is empty, and can cache it accordingly.
      if (empty($output['view_build'])) {
        $output = ['#cache' => $output['#cache']];
      }
CommentFileSizeAuthor
#2 2678230-1-title_notice.patch612 bytesnils.destoop
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zuuperman created an issue. See original summary.

nils.destoop’s picture

FileSize
612 bytes

Following patch fixes the issue.

nils.destoop’s picture

Status: Active » Needs review
aspilicious’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ademarco’s picture

Status: Closed (fixed) » Reviewed & tested by the community

The problem reported by this issue is still there on current dev branch and the patch proposed at #2 actually solves it. I'm re-opening and marking this as RTBC for maintainers consideration.

aspilicious’s picture

Status: Reviewed & tested by the community » Fixed

I forgot to push... Whoops

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.