? Success

User tests: Successful: Unsuccessful:

avatar colivier
colivier
18 Mar 2015

Steps to reproduce the issue

1) Set error reporting in Joomla configuration to maximum.
2) Use a form with a GroupedList field.
3) Select some items and save the form
4) Put the attribute readonly of the field by code or by the manifest of the form.
5) Reopen the form
6) You'll see a PHP warning htmlspecialchars() expects parameter 1 to be string, array given in /libraries/joomla/form/fields/groupedlist.php on line 169

Suggested solution
I suggest to do the same thing than in the List field.

avatar colivier colivier - open - 18 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 18 Mar 2015
Labels Added: ?
avatar bertmert
bertmert - comment - 19 Mar 2015

Even if Icouldn't see a warning (error_reporting Maximum), you're right, this form field doesn't support readonly.

@test Success after patch. Tested disabled, readonly, multiple.

Because it was hard for me to find a form with groupedlist field:

My test:
Add to /administrator/.../com_content/...forms/article.xml
below line 147 (< fieldset name="basic" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL" >)

these lines:

<field name="mylistvalue" 
 type="groupedlist" 
 default="" 
 label="Select from groupedlist" 
 description="">
<group label="Group 1">
<option value="0">Option 1</option>
<option value="1">Option 2</option>
</group>
<group label="Group 2">
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</group>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
</field>

Now you see this field in article edit view > Tab Options.
And can add readonly and/or multiple and so on....

avatar colivier
colivier - comment - 19 Mar 2015

bertmert, thank you very much for the test

avatar zero-24 zero-24 - change - 22 Mar 2015
Category Libraries
avatar zero-24 zero-24 - alter_testresult - 11 Apr 2015 - bertmert: Tested successfully
avatar zero-24
zero-24 - comment - 11 Apr 2015

@test successful thanks @colivier and @bertmert Moving to RTC now!


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

avatar zero-24 zero-24 - test_item - 11 Apr 2015 - Tested successfully
avatar zero-24 zero-24 - change - 11 Apr 2015
Status Pending Ready to Commit
avatar zero-24 zero-24 - change - 11 Apr 2015
Labels Added: ?
avatar colivier
colivier - comment - 27 Apr 2015

The desabled attribute is set when the readonly attribute is present to avoid user's confusion, otherwise the grouplist could be changed by the user.

In addition, when the readonly attribute is present, the name of the groupedlist is not set and in the same time another input of type hidden is created with the name of the grouplist to send the value of the field.

avatar wilsonge wilsonge - change - 25 May 2015
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 25 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 2 Jul 2015
Milestone Added:
avatar zero-24 zero-24 - change - 2 Jul 2015
Milestone Added:
avatar Kubik-Rubik
Kubik-Rubik - comment - 9 Jul 2015

What is the state of this PR? @colivier @wilsonge @phproberto

avatar colivier
colivier - comment - 9 Jul 2015

The tests were successful but now I do not know what to do

avatar Kubik-Rubik Kubik-Rubik - change - 3 Sep 2015
Milestone Added:
avatar Kubik-Rubik Kubik-Rubik - change - 3 Sep 2015
Milestone Removed:
avatar roland-d roland-d - change - 9 Sep 2015
Status Ready to Commit Pending
avatar roland-d
roland-d - comment - 9 Sep 2015

Setting this back to Pending because @phproberto made a very good point with his comment on the code:
https://github.com/joomla/joomla-cms/pull/6494/files#diff-b1b272be917894e1db8f736bbc4191a0R153

I read the reply by @colivier but I am not sure I fully understand. If in the XML definition the field is set to be readonly, the field shouldn't be disabled, it should be made readonly. Sure a field can be changed by the user but that is up to the person who decides to use this field with such a setting.

So I do think we need to change the readonly to be readonly and not disabled.


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

avatar joomla-cms-bot joomla-cms-bot - change - 9 Sep 2015
Labels Removed: ?
avatar colivier
colivier - comment - 9 Sep 2015

Are you test the steps to reproduce the issue (see above) ?

avatar roland-d
roland-d - comment - 14 Sep 2015

@colivier Yes, I was able to reproduce the issue. Your change fixes the issue but also touches another issue. That issue is that the readonly and disabled are treated the same way. That is what Roberto commmented on. However, seeing that the same "fix" is applied in the list field, I would say let's accept your proposal.

avatar roland-d roland-d - test_item - 14 Sep 2015 - Tested successfully
avatar roland-d roland-d - change - 14 Sep 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2015
Labels Removed: ?
avatar roland-d roland-d - change - 14 Sep 2015
Status Pending Ready to Commit
avatar roland-d roland-d - change - 14 Sep 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-09-14 00:03:20
Closed_By roland-d
avatar roland-d roland-d - close - 14 Sep 2015
avatar roland-d roland-d - reference | 98b98e7 - 14 Sep 15
avatar roland-d roland-d - merge - 14 Sep 2015
avatar roland-d roland-d - close - 14 Sep 2015
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment