J3 Issue ?
avatar N6REJ
N6REJ
14 Jan 2019

Steps to reproduce the issue

create a subform field.
form.txt
( wouldn't allow direct pasting of form field )
examine backend. You'll see 4 rows of fields instead of 2 rows with defaults

image

change form type to repeatable
examine backend...
you get single row ( NOT SURPRISING )
image
put type back to subform, remove default values.
image
add default to individual fields
<field name="socialiconname" type="text" label="name" default="mary" /> <field name="socialiconimage" type="media" label="image" default="" /> <field name="socialiconclass" type="text" label="class" default="fa fa-facebook" /> <field name="socialiconurl" type="url" label="url" default="http://no.net" />
image

Expected result

multiple rows with defaults set per subform field.

Actual result

see above.

System information (as much as possible)

systeminfo-2019-01-14T02_54_24+00_00.txt

Additional comments

I've tried dozens of possibilities and nothing seems to work properly.

avatar N6REJ N6REJ - open - 14 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jan 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Jan 2019
avatar N6REJ N6REJ - change - 14 Jan 2019
The description was changed
avatar N6REJ N6REJ - edited - 14 Jan 2019
avatar dgrammatiko
dgrammatiko - comment - 14 Jan 2019

@N6REJ this is expected. The repeated fields, in the current implementation, are just a hard copy of the initial provided field. So whatever the default value there will be repeated on the subsequent fields. It's designed that way, it's not a fault or limitation.

PS if you need deferent default values then spawn different fields...

avatar N6REJ
N6REJ - comment - 15 Jan 2019

@dgrammatiko oh wow... Why the downgrade from repeatable? That was an important feature imo.
So what is the purpose/use of the "default" parameter? https://docs.joomla.org/Special:MyLanguage/subform_form_field_type Says to use a json string which afaik I'm doing correctly.

avatar SharkyKZ
SharkyKZ - comment - 15 Jan 2019

This should work:

{"socialArray0":{"socialiconname":"facebook","socialimage":"","socialclass":"fa fa-facebook","socialiconurl":"http://no.net"}, "socialArray1":{"socialiconname":"Youtube","socialimage":"","socialclass":"","socialiconurl":""}}

It's how the values are stored in the database.

avatar N6REJ
N6REJ - comment - 15 Jan 2019

very interesting, ty! I assume this would go in the "default" parameter

avatar SharkyKZ
SharkyKZ - comment - 15 Jan 2019

Yes, it would go to default attribute. There was an error in the above code. Fixed now.

avatar dgrammatiko
dgrammatiko - comment - 16 Jan 2019

@N6REJ sorry I was wrong, probably because I don't use extensively this form field

avatar Fedik
Fedik - comment - 20 Jan 2019

I think it can be closed, as it not an issue, but incorrect usage

avatar N6REJ
N6REJ - comment - 21 Jan 2019

@Fedik not incorrect usage necessarily, more like undocumented usage!

@dgrammatiko it's fine :D your right way more then your wrong lol

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category Fields
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar brianteeman
brianteeman - comment - 29 Dec 2019

This should be closed base don @Fedik comment above

avatar HLeithner HLeithner - change - 29 Dec 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-12-29 22:10:43
Closed_By HLeithner
avatar HLeithner HLeithner - close - 29 Dec 2019

Add a Comment

Login with GitHub to post a comment