Open billymedia opened 3 years ago
@ben-callaway I'm now getting this issue as well on a staging server, but not in my local version of the site.
The issue appears to be that the field outputs in the CP an extra '#' character before the hex code (e.g., ##336699 instead of #336699)
I'm actually seeing them without any #
symbol on my end.
I wonder if the setting to control the output format is affecting things in the backend.
Hmmm ... I had to set the presets to output in 454545 (no # symbol) format to avoid getting double ## on the front-end, but I still get the double ## in the CP on Craft 3.6.11.2 with latest Colorit.
I thought I might have to do something like #{{ myColorField | slice(-6) }} everywhere I had a Colorit field, but it seems okay on the front-end with the 454545 format.
Yeah, something's definitely wonky.
Can this get bumped up in priority, @ben-callaway or @samhibberd ?
Possible fix: Edit and re-save any color presets you have.
EDIT: Note that you can even do this on live sites that have admin changes disabled... just navigate to yoursite.com/admin/colorit/presets
manually.
Bumping this post up because I am still seeing the issue. I've tried editing and re-saving presets but that did not fix the issue.
Would love to use this plugin on a production site for a client but this bug is really preventing us from using it at all.
Any updates on when this might be fixed?
Sorry @BallardB - will take another look!
Thanks @ben-callaway I really appreciate it!
Any news on this?
Hi @ben-callaway, is there any update on this?
Not fully tested this yet, as a quick fix changing line 26 in /templates/_fields/colorit/input.twig to the below is working for me
{% set processedColor = field.allowOpacity and opacity < 100 ? craft.colorit.colors.hexToRgba(paletteColor.color, opacity) : ('#' in paletteColor.color ? paletteColor.color : '#' ~ paletteColor.color) %}
I'm experiencing the same issue, and this is preventing me from saving any changes to a matrix block, because all preset colors will be lost and break the site.
Hi For removed ## in frontend code fields/coloritField.twig at getPalette() in 305
if (strpos($palette[$paletteColor['handle']]['color'], '#') !== false) {
$palette[$paletteColor['handle']]['color'] = trim($palette[$paletteColor['handle']]['color'], '#');
}
@ben-callaway I am experiencing this issue after updating to 3.0.0
Also, downgrading back to 1.0.9.3
now throws this error:
Any updates? Just ran into the same issue again.
As described in this thread: https://github.com/presseddigital/colorit/issues/32
When you create a colorit field with the colours preset, the colours dont appear when editing the entry.
I saw that you posted an update with a fix, but i am using Colorit 1.1.2.1 with Craft CMS 3.7.6 and its still showing the issue.
What can i do to fix this?