Problem/Motivation

Wen a user is new to an organization or there is no data for a block like 'latest mail'. The block is disappearing.

Proposed resolution

  • Settings page, with the option to show custom text or hide blocks with no data.
  • Settings page, with the option to write custom text for each block to be shown.

Issue fork o365-3272948

Command icon 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

Jesse van de Water created an issue. See original summary.

jesse van de water’s picture

Issue summary: View changes

fabianderijk made their first commit to this issue’s fork.

bramdriesen’s picture

Status: Active » Reviewed & tested by the community

RTBC then?

fabianderijk’s picture

Status: Reviewed & tested by the community » Fixed

I've just merged the MR.

bramdriesen’s picture

Can you tag a new release? @fabianderijk

bramdriesen’s picture

Assigned: jesse van de water » Unassigned
bramdriesen’s picture

Status: Fixed » Active

I just tested this, this is not working as it should.

For example, the o365 calendar block is still throwing the error:

TypeError: Drupal\Core\Cache\CacheableMetadata::createFromRenderArray(): Argument #1 ($build) must be of type array, bool given, called in /var/www/drupal9/xxx/web/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php on line 111 in Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() (line 149 of /var/www/drupal9/xxx/web/core/lib/Drupal/Core/Cache/CacheableMetadata.php)

Which I fixed in my approach in #3298398: Outlook Calendar - Block should return something

The conditional block logic also isn't working when using blocks in combination with layout builder (dashboard module in my case)

Screenshot conditional not working

bramdriesen’s picture

Status: Active » Needs work
bramdriesen’s picture

StatusFileSize
new11.75 KB

bramdriesen’s picture

Status: Needs work » Needs review

Hi highly doubt this was actually ever tested. Anyway, the CR I created fixes all issues, sets default values to the form so you actually don't loose your changes the next time you edit the block and some various code formatting issues are fixed.

I also don't understand why t() strings passed the code review. When in a class $this->t() should be used.

  • fabianderijk committed b4baed2 on 3.0.x
    Issue #3272948 by Jesse van de Water, BramDriesen, fabianderijk: Blocks...
fabianderijk’s picture

Status: Needs review » Fixed

Mmm, I thought we tested this, I've merged your MR, and added some extra fixes.

bramdriesen’s picture

Thnx :-)

Status: Fixed » Closed (fixed)

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