Using the drupal_block for a block that returns empty (in the case of Facets when the facet doesn't exist), throws an error because Facets returns an empty array. The drupalBlock method assumes that there is a #cache key even if the block is empty.

Comments

elgordogrande created an issue. See original summary.

elgordogrande’s picture

StatusFileSize
new473 bytes

Here is a patch that includes the error check.

chi’s picture

Is empty string a valid value for #cache property? I propose we use empty array instead.

fabianx’s picture

Status: Needs review » Needs work

Yes, needs to be an array.

alesbencina’s picture

Is this issue solved in twig_tweak 8.x-2.0?

prashant.c’s picture

Status: Needs work » Needs review
StatusFileSize
new440 bytes

@elgordogrande

Thanks for the initial patch.

@Fabianx

Suggested change is done, please review.

  • Chi committed 40d9540 on 8.x-2.x authored by Prashant.c
    Issue #2958571 by elgordogrande, Prashant.c, Fabianx: DrupalBlock cache...
chi’s picture

Version: 8.x-2.0-rc4 » 8.x-2.x-dev
Status: Needs review » Fixed

Thanks.

Status: Fixed » Closed (fixed)

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