Postponed (maintainer needs more info)
Project:
Office Hours
Version:
8.x-1.x-dev
Component:
Code - formatter
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2024 at 20:41 UTC
Updated:
21 Jun 2024 at 10:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kalpanajaiswal commentedI tried to replicate the issue but it didn't reproduce.
Drupal version: 10.2.7
office_hours module version: 1.17.0
Comment #3
jeremyvii commentedIn order to replicate, all the hours must empty on the entity.
Without Layout Builder.

With Layout Builder

Comment #4
johnvThis should not be possible. I guess all other settings are not used then, too. Please check that.
Please check if the correct ViewMode is used.
IN the code, you can see several references to
layout_builderplease grep them and test the behaviour.Comment #5
jeremyvii commentedI can confirm that I am using the correct view mode. After further investigation, this appears to be happening with any field in Layout Builder. In
Drupal\layout_builder\Plugin\Block\FieldBlock::blockAccess, the selected field'sisEmpty()method is checked, and iftrue, access to the block is forbidden. There appears to be an issue for the Drupal project to try to add a setting to allow the field to display, even if empty. It would be niceOfficeHoursItemList::isEmpty()returnedfalseifshow_emptyis checked, but I can understand how that would be messy to implement.Drupal\layout_builder\Plugin\Block\FieldBlock::blockAccessComment #6
johnvI tried to move the 'show_empty' into $items->isEmpty(), but the formatter settings are lost in the ItemList.
I does not seem right to override the layout_builder code, even if it core.
Also, it seems as I have a higher Drupal version then you, since in my 10.2.x system, #3119786: Default values are not displayed for image fields placed in Layout Builder is committed, removing the line you mention.
Perhaps the problem is solved in a higher Drupal version?