Hello;

This is a really minor bug, but still relevant.

The hint for the color palette states that:

Selectable color palette to accompany the Spectrum Widget. Separate values with a comma, and group them with square brackets. Ex:
["#fff","#aaa","#f00","#00f"],
["#414141","#242424","#0a8db9"] 

But this produces a JSON parse error on Spectrum (v1.8.0) and sets the field back to the default behavior.

Instead, the expected pattern seems to be a separate list of arrays, each one on a new line, without the comma separator:

["#fff","#aaa","#f00","#00f"]
["#414141","#242424","#0a8db9"]
CommentFileSizeAuthor
#2 color-field-3016158-2.patch1.26 KByoftahe.addweb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idiaz.roncero created an issue. See original summary.

yoftahe.addweb’s picture

FileSize
1.26 KB

@idiaz.roncero, Please find my patch that resolves the coding standard error for defining an array, hope it is as per your requirement. Kindly review my patch & share your view for the same.

Thanks!..

idiaz.roncero’s picture

Thank you nilesh.addweb

I just applied the patch and it works perfectly.

This was a really small issue, thank you for taking it into consideration!!

scottsawyer’s picture

God, this had me so confused. Since it does matter, it might be worth adding the text, "One group per line". I think it would also be good to add some validation, trim and tidy up the input to reduce the likelihood of JSON validation errors like I was seeing in my console.

NickDickinsonWilde’s picture

Do note that issues with patches should have status set to 'Needs Review' rather than active.

  • NickWilde committed 922fe4d on 8.x-2.x
    Issue #3016158 by nilesh.addweb, idiaz.roncero, scottsawyer, NickWilde:...
NickDickinsonWilde’s picture

Status: Active » Fixed

Thanks for the discussion and patch.
I've implemented some cleanup so most methods of writing out the pallete values will work - still has to be one group per line and I've specified that.

Status: Fixed » Closed (fixed)

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