Closed (duplicate)
Project:
Drupal core
Version:
8.4.x-dev
Component:
datetime.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2015 at 12:25 UTC
Updated:
9 Sep 2017 at 01:26 UTC
Jump to comment: Most recent
Comments
Comment #2
hussainwebCan you give an example output? What is the HTML that you see?
Comment #3
seppelM commentedThats the output.
Both get added outside and inside the container.
Comment #4
seppelM commentedComment #5
tr commentedConfirmed as a bug. It's even worse if you include a #title because then one of the prefixes is displayed before the title and the other one is displayed after the title.
(I'm pretty sure this has nothing to do with the ajax markup problem cited in the original post.)
There are a number of other issues with the markup here. First is that the #title is displayed as an <h4> instead of as part of the <label> as it is with other form elements. This makes styling of form elements inconsistent. Second, the #title is placed OUTSIDE of the
<div class="form-item ..."instead of inside, which means .form-item isn't a good selector for the entire element. Again, this is not consistent with what any of the other form elements does.Here is a real use case where I added the prefix and suffix to see what would happen:
And here is the markup:
Using paragraph tags instead of divs it's stranger - note it creates BOTH open and close paragraph tags for the TWO prefixes, then BOTH open and closed tags for the TWO suffixes (but notice the suffix doesn't get the class="bug" ...):
EDIT: I had to edit this issue to make it readable again; some HTML tags inside <?php code block in this post disappeared due to #2725111: < within <?php is not escaped for codefilter_prism.
Comment #10
tacituseu commentedEven though this issue is earlier, closing in favor of #2783617: Datetime FAPI element type duplicates #prefix and #suffix as it has a patch.
Comment #11
tr commented@tacituseu: I would appreciate it if, before you close an issue, you check to make sure it really is addressed by the newer issue.
My comments from 18 months ago are NOT all addressed by the patch in #2783617: Datetime FAPI element type duplicates #prefix and #suffix. So now I have to re-create the work I did 18 months ago and re-post in that issue, where they're going to tell me that the markup problems are not part of the datetime.module component, they belong in the FAPI queue or the markup component (which is why I did not put this issue into the datetime.module queue, btw ...). Then I'm going to have to open a new issue which is essentially the same as this, but two years newer, in hopes that someone will take a look at this.
That's progress?
Comment #12
tacituseu commented@TR: I suspect the reason it didn't get the attention from the maintainer is because it didn't have proper component assigned, FAPI/markup is just too generic.
They look the same to me, the other one has comments from @mpdonadio, and still is at needs work
because not all issues were addressed, feel free to reopen if you feel strongly about it.