Form display -> Field formatter -> Color Boxes: User-defined colors cannot be changed. After the change, "No default colors" is always displayed. I can see the default colors in the field configuration.

CommentFileSizeAuthor
#4 color-change.patch1.02 KBsajid_007

Comments

HeavyStoneHead created an issue. See original summary.

sajid_007’s picture

Hi,
could you please provide steps to reproduce.

heavystonehead’s picture

install Drupal 8.9.0 (Standard Profile)
install Color Field 8.x-2.3
Add Color Field to Article (#123abc; 1) (/admin/structure/types/manage/article/fields)
Change Formartter to "Color boxes" (/admin/structure/types/manage/article/form-display)

you see right the default Colors: "#AC725E [... and so on ...] #A47AE2"
now change colors: "#ff0000,#00ff00,#0000ff" and update
the text change from "#AC725E [... and so on ...] #A47AE2" to "No default colors" and Save
Now you can see the default colors, not your custom colors in the field (/admin/structure/types/manage/article/fields/node.article.field_test_color_field) or (/node/add/article)

sajid_007’s picture

StatusFileSize
new1.02 KB

Hi,

Here is the patch.

Note- "When you change the color in form-display in "color boxes" always use "#FF0000" instead of "#ff0000".

Please review the patch.

nickdickinsonwilde’s picture

Status: Active » Needs review

Will take a real look later, but setting to NR to trigger the test bot, thanks for the report/details and patch you two.

nchristensen’s picture

#4 worked for me (running core 8.9.0; color_field 8.x-2.3)

heavystonehead’s picture

#4 Works for me

@sajid_007 thx for patch and Note.

Note: the unfixed Version transform the letter to lowercase. The new Version Works only with upercase.

sajid_007’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

hussainweb’s picture

I'm confused. Was this fix committed? I don't see any commit. :/

Also, I'm thinking there are other improvements possible here. I think the biggest gap here is that during validate lowercase hex codes are fine. In fact, the validate converts it to lower case hexcode. However, when building summary and the form element, only uppercase is allowed.

heavystonehead’s picture

basically the patch works. After the patch, he no longer converts the hex values to lower case. However, only hex values in capital letters are accepted in the input.

It would be better if all forms were accepted.

hussainweb’s picture

@HeavyStoneHead, since this issue was closed, I created another one at #3156520: Color Boxes - can't change colors. The patch in there works perfectly for me and also accepts mixed-case input.