Hello,

Version 7.x-2.11-beta2 added #2447277: Performance: replace sylesheets[all][] with attached which appears to have introduced a bug where date fields are always showing even if their value is empty.

It seems the $element array in date_field_formatter_view() is populated with the #attached property but shouldn't in case there is nothing to show.
Since field_default_view() then only checks if the returned $elements array is not empty and creates the render array for the field.
We then end up with the field label being shown with no field value.

Patch will follow shortly.

Comments

herved created an issue. See original summary.

herved’s picture

Status: Active » Needs review
StatusFileSize
new1023 bytes
herved’s picture

Issue summary: View changes
damienmckenna’s picture

That makes sense. Thanks.

skylord’s picture

Thanks! Patch #2 works OK and fixes that regression.

steinmb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new24.91 KB
new21.09 KB
new15.18 KB

Patch apply cleanly and make sense. Manual testing. Three date fields, all with different storage. All fields empty:

Empty date fields

Before patch

Empty Date field rendered

After the patch

date after test

Date fields containing data behave as expected.

danielveza’s picture

Another RTBC for me. Would be great to get a release done with this in it. :)

  • DamienMcKenna committed a07449c on 7.x-2.x authored by herved
    Issue #3032391 by herved, steinmb, skylord, DanielVeza: Empty date...
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thank you all.

Status: Fixed » Closed (fixed)

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