? Pending

User tests: Successful: Unsuccessful:

avatar izharaazmi
izharaazmi
17 Oct 2016

Summary of Changes

Currently we ignore the hint attribute for List type form field. This PR is to utilize it if provided to add placeholder (as well as data-palceholder for chosen and select2) attributes to the rendered input control.

Testing Instructions

Create a form field for type list using xml in any component, provide the hint attribute as we do for text type fields. The hint should be visible when no options are selected on the UI.

        <field
            name="test_list"
            type="list"
            multiple="true"
            hint="Test Hint for multiple"
        />
        <field
            name="test_list_single"
            type="list"
            hint="Test Hint for single"
        />

Without this PR, the hint was ignored.

Also test with chosen, select2.

Documentation Changes Required

We need to add the information about this attribute (hint) being available in list field also.

avatar izharaazmi izharaazmi - open - 17 Oct 2016
avatar izharaazmi izharaazmi - change - 17 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2016
Category Libraries
avatar andrepereiradasilva andrepereiradasilva - test_item - 17 Oct 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 17 Oct 2016

I have tested this item successfully on 4265d18

works as described


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

avatar zero-24
zero-24 - comment - 5 Nov 2016

@izharaazmi can you fix the conflicts here too? If ready please ping me for a test ?

avatar izharaazmi
izharaazmi - comment - 5 Nov 2016

Omg. ? Thats not just a conflict. The affected method was abstracted. What do I do @zero-24 ?

avatar zero-24
zero-24 - comment - 5 Nov 2016
avatar izharaazmi
izharaazmi - comment - 5 Nov 2016

@zero-24 Yeah right, I was just thinking whether it calls for a new PR. I have applied the changes to the new abstract class method. Please test.

avatar andrepereiradasilva andrepereiradasilva - test_item - 5 Nov 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 5 Nov 2016

I have tested this item successfully on e394f8f

still works as described


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

avatar Bakual Bakual - test_item - 5 Nov 2016 - Tested unsuccessfully
avatar Bakual
Bakual - comment - 5 Nov 2016

I have tested this item ? unsuccessfully on e394f8f

Placeholder isn't a valid attribute for selects, radios and checboxes to my knowledge. That's why it isn't supported.

Also I see no hint in a HTML select when I add it to a list field (tested with Chrome). In chosen "selects" I can make it appear, but I need to add a stupid empty option to it which then allows the clear the selected value. Only then I will see the hint.

I honestly don't see the point of adding something which isn't supported by the HTML spec.


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

avatar ggppdk
ggppdk - comment - 5 Nov 2016

Placeholder isn't a valid attribute for selects, radios and checboxes

Exactly placeholder is invalid HTML and should be removed and only keep data-placeholder="..."

and then this HTML will be valid

 $attr .= !strlen($hint) ? ''
  :' placeholder=' . json_encode($hint) . ' data-placeholder=' . json_encode($hint); 

data-placeholder, is needed by chosen JS (and select2 JS) to show their typing prompt in

  • select-multiple case
avatar anibalsanchez
anibalsanchez - comment - 5 Jan 2017

I have tested this item ? unsuccessfully on e394f8f

After this change is applied, when you try to edit an article this notice appears: JGLOBAL_USE_GLOBAL_VALUE_NOT_FOUND


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

avatar anibalsanchez anibalsanchez - test_item - 5 Jan 2017 - Tested unsuccessfully
avatar ggppdk
ggppdk - comment - 6 Jan 2017

The hint needs to be escaped by using JText::_(..., true) or use json_encode() to when appending it
and also the placeholder=... must be used !

  • it is not valid HTML
  • it is not needed since both chosen JS and select2 JS can use data-placeholder=...
avatar Gavakshi
Gavakshi - comment - 31 Mar 2017

@izharaazmi please review this

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 May 2017

If this PR get no Response, it will be closed at 22th June 2017.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Jun 2017

can a Maintainer please look whats next with this PR?


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

avatar zero-24 zero-24 - change - 21 Jun 2017
The description was changed
Status Pending Needs Review
avatar zero-24 zero-24 - edited - 21 Jun 2017
avatar roland-d
roland-d - comment - 22 Jul 2018

Closing this as there has been no response. @izharaazmi feel free to reopen this once you have implemented the feedback given. Thank you.

avatar roland-d roland-d - change - 22 Jul 2018
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2018-07-22 19:56:53
Closed_By roland-d
avatar roland-d roland-d - close - 22 Jul 2018

Add a Comment

Login with GitHub to post a comment