Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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"]
Comment | File | Size | Author |
---|---|---|---|
#2 | color-field-3016158-2.patch | 1.26 KB | yoftahe.addweb |
Comments
Comment #2
yoftahe.addweb CreditAttribution: yoftahe.addweb at AddWeb Solution Pvt. Ltd. commented@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!..
Comment #3
idiaz.ronceroThank 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!!
Comment #4
scottsawyerGod, 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.
Comment #5
NickDickinsonWildeDo note that issues with patches should have status set to 'Needs Review' rather than active.
Comment #7
NickDickinsonWildeThanks 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.