User tests: Successful: Unsuccessful:
On the user registration view, fieldset descriptions were not shown, while on the profile view they are. This includes the description of the field groups. This commit adds the display of those descriptions on registration.
Under the user manager in the administrator backend, go to field groups and create a new group or edit an existing one. Set the description of the field group and save it. Afterward on the frontend go to the user registration view at index.php?option=com_users&view=registration.
The descriptions for the field groups are shown under their names on the registration view.
Unknown. I was unable to find any documentation for fields on the users component specifically.
Status | New | ⇒ | Pending |
I thought that the description of a fieldset was a legend
Not exactly. It doesn't include the description, only the name of the fieldset is shown in the legend. This is different to how the profile view behaves.
I thought that the description of a fieldset was a legend
I think we've got mixed uses in core (i.e. I know in com_privacy we're using a description for the <legend>
and one of Phil's issues highlights why that's not so good). Since our fieldsets support a label
attribute that would be the best thing to put in the <legend>
element and let the description be a paragraph or div or whatever block element.
I thought that the description of a fieldset was a legend
I think we've got mixed uses in core (i.e. I know in com_privacy we're using a description for the
<legend>
and one of Phil's issues highlights why that's not so good). Since our fieldsets support alabel
attribute that would be the best thing to put in the<legend>
element and let the description be a paragraph or div or whatever block element.
That is indeed how the profile view handles it.
Title |
|
Title |
|
@IsaacWG I meant that the purpose of the legend tag in html is to show a description of the fieldset. So I would expect that if I create a description for a fieldset it will be displayed inside a legend tag
Remember the legend has semantic meaning
Gotcha. In that case, should the description be placed in the legend tag instead of the label in other places as well? If so, what will happen to the label text?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend
Between that and W3C specs what I'm taking is that for this form definition:
<form>
<fieldset label="Short Summary" description="Longer blurb about this fieldset"/>
</form>
The label should be what we put in the <legend>
and if there's a longer description it should be a block element inside the fieldset. Otherwise you end up with #22630 where the legend ends up being a big blob of text.
22630 is just a CSS issue.
Category | ⇒ | Front End com_users |
So you're saying that is the semantically correct use of a <legend>
tag? Because that really does not feel right to me at all.
I think I'd have to agree with @mbabker on this, at least if we're following the W3C specs at https://www.w3.org/TR/html50/forms.html#the-legend-element:
The
legend
element represents a caption for the rest of the contents of thelegend
element's parentfieldset
element, if any.
A caption is defined as
a title or brief explanation appended to an article, illustration, cartoon, or poster.
In my humble opinion this seems to fit much better with the label than the description, since descriptions can get quite long.
<div>
instead of a <p>
to avoid invalid HTML if description contains paragraphs etc.* Shouldn't we use a `<div>` instead of a `<p>` to avoid invalid HTML if description contains paragraphs etc. * Why do we need to escape() (html_entities) the description?
There "shouldn't" be any HTML in the descriptions and therefore no <p>
tags, or at least I can't think of any reason why there should be. Escaping the description helps prevent XSS attacks in case the description is ever set by user input or another untrusted source.
There "shouldn't" be any HTML in the descriptions and therefore no
tags, or at least I can't think of any reason why there should be
So, it's forbidden to add several paragraphs or line breaks or ... in a form description? Sounds strange for me.
in case the description is ever set by user input or another untrusted source.
In this case here that's a little bit paranoid, I think. Who can change the description?
I see absolute no reason NOT to use a <div>
- container plus CSS class here.
Please keep in mind everybody, that the point of this pull request was to make the registration view show the fieldset descriptions in the same way that the profile view does. If we need to change how the registration view behaves on this, we should change the profile view as well to keep things consistent.
In this case here that's a little bit paranoid, I think. Who can change the description?
Perhaps I am being a bit paranoid. Yes, almost always it's going to be an administrator setting the descriptions, and I suppose if say a plugin is adding its own fieldsets and setting the descriptions it should be up to that plugin to escape any user provided data.
In any case, the profile view should be changed as well to allow HTML if we let the registration view allow it.
I have tested this item
We reproduced the testing instructions and the description appeared as expected
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Title |
|
Title |
|
Because this is a new feature we can't merge in to J3.9, please create a new pull request for Joomla! 4.0
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-05 17:02:51 |
Closed_By | ⇒ | HLeithner |
I thought that the description of a fieldset was a legend