Needs review
Project:
Date
Version:
7.x-2.x-dev
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2014 at 16:46 UTC
Updated:
28 Nov 2019 at 13:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mqannehComment #2
mqannehComment #3
mqannehComment #4
joelstein commentedI'm experiencing the same problem. The "Render as a regular field " works flawlessly except for "Select list" field widgets with only one value (year).
To test this out, I created a whole bunch of combinations of date fields, in the fieldset, as a normal field, and with the popup, select, and text widgets. See the first image to see the broken select labels when only the year field is used.
The patch mqanneh provided fixes that use case, but it breaks rendering for "Text field" widgets when rendering as a regular field. See the next attached image to see the duplicate text field labels with mqanneh's patch.
I did a bunch of testing, and it looks like the code in date.theme that hides the #title_display should only be called if using the text field widget. By restricting that code to the text field widget, it won't break anything for select list fields. See the last attached image to see the select labels fixed, and everything else rendering as expected. The attached patch accomplishes this.
(As an aside, I think it's strange that we give users the option to configured a field with "labels above" for text field widgets, since they never appear. Just a minor usability issue I noticed while researching this.)
Comment #5
joelstein commentedRats, just discovered that my patch breaks Popup fields with date only fields (no time fields).
Back to the drawing board.
Comment #6
abu-zakham commentedPatch #1 works fine with me, thank you @mqanneh.
Comment #7
abu-zakham commentedYou are right joelstein. in comment #5 , patch #1 and patch #4 breaks Popup fields with date only fields (no time fields).
Comment #8
bjcooper commentedCan we just check for date popup as well (date.theme line 460)?
Comment #9
damienmckennaReminder: the "assigned" field is for indicating that you are actively working on something, it is not for indicating that you reported a problem or that you previously worked on a problem and would like attribution. Thanks.
Comment #10
aurelianzaha commentedHi,
I had a bit different issue, but the attached patch might solve the original problem as well.
The issue that I had is that the label of the main field was not rendering when granularity of date only was selected, although the 'Position of date part labels' was none.