?
avatar infograf768
infograf768
17 Mar 2017

This screenshot explains it more than a thousand words

screen shot 2017-03-17 at 17 58 12

Multiple can't apply here and we need specific Default Usergroups I guess a bit similar to the User field.

@laoneo @Bakual

avatar infograf768 infograf768 - open - 17 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 17 Mar 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Mar 2017
avatar brianteeman
brianteeman - comment - 17 Mar 2017

why cant it be multiple?

avatar infograf768 infograf768 - change - 17 Mar 2017
Category com_fields Plugins
avatar infograf768
infograf768 - comment - 17 Mar 2017

you don't choose Yes and No And sUse plugin together.

We should have a field where we list usergroups ids and no default value: look at user field

avatar dgt41
dgt41 - comment - 17 Mar 2017

@infograf768 the label refers to the field not the select tag next to it, so yes you can have multiple usergroups (it's not multiple values like: yes, no,none)

avatar infograf768
infograf768 - comment - 17 Mar 2017

EDIT:
In fact it is only the DEFAULT VALUE which should be changed as done in User field.
It indeed can be multiple.

avatar infograf768
infograf768 - comment - 17 Mar 2017

screen shot 2017-03-17 at 18 42 11

avatar infograf768
infograf768 - comment - 17 Mar 2017

And in this case (when corrected as User), and looking at the code, Multiple is useless. It is no use in the params in the plugin as in the specific created field.

We should have instead of the 2 fields, something like

<?xml version="1.0" encoding="utf-8"?>
<form>
	<field
		name="default_value"
		type="textarea"
		filter="raw"
		label="PLG_FIELDS_USERGROUPS_DEFAULT_VALUE_LABEL"
		description="PLG_FIELDS_USERGROUPS_DEFAULT_VALUE_DESC"
	/>
</form>

and

PLG_FIELDS_USERGROUPS_DEFAULT_VALUE_LABEL="Default Usergroups"
PLG_FIELDS_USERGROUPS_DEFAULT_VALUE_DESC="A comma separated list of usergroups ids."
avatar brianteeman
brianteeman - comment - 17 Mar 2017

Multiple refers to the USER selecting multiple usergroups when this field is displayed

avatar brianteeman
brianteeman - comment - 17 Mar 2017

screenshotr18-13-08

avatar infograf768
infograf768 - comment - 17 Mar 2017

ok. now what is the default value for?

avatar laoneo
laoneo - comment - 18 Mar 2017

The default value preselects some ustegroups when the field is the first time visible when editing an article. If the field got emptied on an article save, then it reverts to the default value. Same behavior as everywhere in Joomla.

avatar infograf768
infograf768 - comment - 18 Mar 2017

Ok, this is what I found.
If one usergroup id is entered in default value, then the chosen usergroup is indeed showing whether Multiple is set to Yes or No.

So, one can't enter in the default value more than one id.

My suggestion is to use specific strings for the default value explaining this.

avatar infograf768
infograf768 - comment - 19 Mar 2017

@laoneo
Is it worth adding a custom Default Value with a tip to explain what that field may do?

avatar laoneo
laoneo - comment - 20 Mar 2017

I guess it is not a bad idea. Then another question pops up. Should we then build in better support to override the default label and description, otherwise we always need to define the whole default field as in #14679? When we want to change some parameters in that field, then we need also update all the overrides as well.

avatar infograf768
infograf768 - comment - 20 Mar 2017

If we have time for that, why not indeed.
if not, let's just do it the same way you did for the User field. In both cases, we will need at least one more language string.

avatar laoneo
laoneo - comment - 20 Mar 2017

Please check #14793 for a label and description override functionality.

avatar laoneo
laoneo - comment - 20 Mar 2017

Guess we can close this one then.

avatar infograf768 infograf768 - change - 20 Mar 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-03-20 07:11:49
Closed_By infograf768
avatar infograf768 infograf768 - close - 20 Mar 2017
avatar infograf768
infograf768 - comment - 20 Mar 2017

Closed as we have a patch.


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

Add a Comment

Login with GitHub to post a comment