office_hours_field_is_empty should use empty() or isset(), since the keys may not exist.

The keys will not exist if an entity is submitted without any values.

This causes field formatters to run with invalid $items variables.

Comments

dpi created an issue. See original summary.

johnv’s picture

Title: Office hours field is empty » Error in function office_hours_field_is_empty

Can you describe your scenario, how to create the error? Simply changing the code to isset/empty needs testing of all the edge cases.
Are your fields filled via UI , or programmatically? (Or perhaps via migrating via e.g., Feeds )

johnv’s picture

Version: 7.x-1.x-dev » 7.x-1.8
Status: Active » Closed (duplicate)
Related issues: +#3000228: Empty day field leads to PDOException