?
avatar N6REJ
N6REJ
10 May 2017

Steps to reproduce the issue

Create 2 fields with similar names.

I have two fields in my template...

<field name="hoverbackgroundColor"
                               class="small-input"
                               label="TPL_SERENITY_FONTS_HOVER_BACKGROUND_COLOR_LABEL"
                               description="TPL_SERENITY_FONTS_HOVER_BACKGROUND_COLOR_DESC"
                               type="color"
                               default=''
                        />
                        <field name="hoverColor"
                               class="small-input"
                               label="TPL_SERENITY_FONTS_HOVER_COLOR_LABEL"
                               description="TPL_SERENITY_FONTS_HOVER_COLOR_DESC"
                               type="color"
                               default=''
                        />

so, now you have got 2 fields
if you put color in the 2nd and save it returns empty
if you put color in the 1st it saves
if you put color in the 1st and 2nd it changes 2nd to match first!!!

craziest thing I've ever seen.

Expected result

colors are independant

Actual result

see above

System information (as much as possible)

both 3.6.5 and 3.7

Additional comments

This worked fine before and does work if the fields are NOT named similarly. Both are in "repeatable" form fields but I don't see that that is relevant since both repeatable and sub use the same color form field system.

avatar N6REJ N6REJ - open - 10 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 10 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 May 2017
avatar Bakual
Bakual - comment - 11 May 2017

I understand you correct that the two fields are named identical? Then that seems to be the expected behaviour to me. The names need to be unique in a form, otherwise one will overwrite the other.

avatar brianteeman brianteeman - edited - 11 May 2017
avatar brianteeman brianteeman - change - 11 May 2017
The description was changed
avatar brianteeman brianteeman - edited - 11 May 2017
avatar brianteeman
brianteeman - comment - 11 May 2017

I have updated thew original comment so that the markup is displayed

avatar Bakual
Bakual - comment - 11 May 2017

I have updated the original comment so that the markup is displayed

Ah, didn't see that. The name shouldn't matter then. I do a similar thing in my template all the way.

This worked fine before and does work if the fields are NOT named similarly. Both are in "repeatable" form fields but I don't see that that is relevant since both repeatable and sub use the same color form field system.

That's most likely related to the repeatable then. I don't know from the top of my head how repeatables are stored. Maybe @Fedik would know more here.

avatar Fedik
Fedik - comment - 11 May 2017

Create 2 fields with similar names.

the names are not similar ?

I cannot reproduce it, in the template form all works fine:

screen 2017-05-11 14 01 40 623x283

however I am not tested in subform since last changes in the color field markup (I try to check later), there was a fix #12994 but no one tested, and now it out of date already

avatar joomla-cms-bot joomla-cms-bot - change - 11 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 11 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 11 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 11 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 May 2017
Category com_fields
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 May 2017
Status New Discussion
avatar N6REJ
N6REJ - comment - 11 May 2017

I haven't tried it with subforms yet. Thats something planned for today or tomorrow. It's interesting that it only happens if the name is related(?) or perhaps its because they are side-by-side. Very strange behavior

avatar Fedik
Fedik - comment - 11 May 2017

I just checked the subform with the color field in the Isis template and all works there for me

avatar Fedik
Fedik - comment - 11 May 2017

@N6REJ please test that #15974

avatar Bakual
Bakual - comment - 11 May 2017

Closing as we have a PR

avatar Bakual Bakual - change - 11 May 2017
The description was changed
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-11 18:46:26
Closed_By Bakual
avatar Bakual Bakual - close - 11 May 2017
avatar N6REJ
N6REJ - comment - 12 May 2017

I'll check it in the late morning

Add a Comment

Login with GitHub to post a comment