? ? Success

User tests: Successful: Unsuccessful:

avatar IsaacWG
IsaacWG
22 Oct 2018

Summary of Changes

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.

Testing Instructions

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.

Expected result

The descriptions for the field groups are shown under their names on the registration view.

Documentation Changes Required

Unknown. I was unable to find any documentation for fields on the users component specifically.

avatar IsaacWG IsaacWG - open - 22 Oct 2018
avatar IsaacWG IsaacWG - change - 22 Oct 2018
Status New Pending
avatar brianteeman
brianteeman - comment - 22 Oct 2018

I thought that the description of a fieldset was a legend

avatar IsaacWG
IsaacWG - comment - 22 Oct 2018

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.

avatar mbabker
mbabker - comment - 22 Oct 2018

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.

avatar IsaacWG
IsaacWG - comment - 22 Oct 2018

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.

That is indeed how the profile view handles it.

avatar IsaacWG IsaacWG - change - 22 Oct 2018
Title
Front-end: Display fieldset descriptions on user registration
[com_users] Front-end: Display fieldset descriptions on user registration
avatar IsaacWG IsaacWG - edited - 22 Oct 2018
avatar IsaacWG IsaacWG - change - 22 Oct 2018
Title
Front-end: Display fieldset descriptions on user registration
[com_users] Front-end: Display fieldset descriptions on user registration
avatar brianteeman
brianteeman - comment - 22 Oct 2018

@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

avatar IsaacWG
IsaacWG - comment - 22 Oct 2018

@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?

avatar mbabker
mbabker - comment - 22 Oct 2018

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.

avatar brianteeman
brianteeman - comment - 22 Oct 2018

22630 is just a CSS issue.

avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2018
Category Front End com_users
avatar mbabker
mbabker - comment - 22 Oct 2018

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.

avatar IsaacWG
IsaacWG - comment - 22 Oct 2018

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 the legend element's parent fieldset 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.

avatar ReLater
ReLater - comment - 23 Oct 2018
  • 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?
avatar IsaacWG
IsaacWG - comment - 23 Oct 2018
* 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.

avatar ReLater
ReLater - comment - 24 Oct 2018

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.

avatar IsaacWG
IsaacWG - comment - 24 Oct 2018

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.

avatar IsaacWG
IsaacWG - comment - 24 Oct 2018

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.

avatar BertaOctech
BertaOctech - comment - 16 Nov 2018

I have tested this item successfully on d7d44c0

We reproduced the testing instructions and the description appeared as expected


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22765.

avatar BertaOctech BertaOctech - test_item - 16 Nov 2018 - Tested successfully
avatar viocassel
viocassel - comment - 3 Feb 2019

I have tested this item successfully on d7d44c0


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22765.

avatar viocassel viocassel - test_item - 3 Feb 2019 - Tested successfully
avatar joomla-cms-bot joomla-cms-bot - edited - 3 Feb 2019
avatar Quy Quy - change - 3 Feb 2019
The description was changed
Status Pending Ready to Commit
avatar joomla-cms-bot joomla-cms-bot - edited - 3 Feb 2019
avatar Quy
Quy - comment - 3 Feb 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22765.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[com_users] Front-end: Display fieldset descriptions on user registration
Front-end: Display fieldset descriptions on user registration
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[com_users] Front-end: Display fieldset descriptions on user registration
Front-end: Display fieldset descriptions on user registration
avatar HLeithner
HLeithner - comment - 5 Jun 2019

Because this is a new feature we can't merge in to J3.9, please create a new pull request for Joomla! 4.0

avatar HLeithner HLeithner - change - 5 Jun 2019
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2019-06-05 17:02:51
Closed_By HLeithner
avatar HLeithner HLeithner - close - 5 Jun 2019

Add a Comment

Login with GitHub to post a comment