No Code Attached Yet J3 Issue
Related to # 14427
avatar jayblaq
jayblaq
21 Mar 2017

Steps to reproduce the issue

Test with any color picker in Joomla such as the Protostar Template and try to add the word transparent. Transparent is a CSS color value for background-color and should work. In other frameworks etc custom color pickers are used to get over this issue.

Expected result

Color value saved as transparent

Actual result

Defaults to last saved value

System information (as much as possible)

Joomla 3x 3.7 etc

Additional comments

Adding this would be part of enabling 3rd party developers to conform to Joomla's API and features.

avatar jayblaq jayblaq - open - 21 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Mar 2017
avatar pepperstreet
pepperstreet - comment - 21 Mar 2017

Good point. Just had a quick look in my local installation. The visual appearance of the form field implies to support "transparent", because it shows the typical "checkerboard". My first thought was, it might be some build-in functionality.
What about using the default value parameter instead? The output is just the field value. So, you might work with that value "transparent".

PS: On the other hand, it results in a "never-empty" field, right? Maybe a related and general question how to deal with the basic field logic for "empty" and "filled" fields. Wouldn't it make sense to display labels of empty fields?

avatar brianteeman
brianteeman - comment - 21 Mar 2017

Pretty sure transparency was added to the color picker.some time ago but
not at computer to double check.

On 21 Mar 2017 9:01 p.m., "pepperstreet" notifications@github.com wrote:

Good point. Just had a quick look in my local installation. The visual
appearance of the form field implies to support "transparent", because it
shows the typical "checkerboard". My first thought was, it might be some
build-in functionality.
What about using the default value parameter instead? The output is just
the field value. So, you might work with that value "transparent".

PS: On the other hand, it results in a "never-empty" field, right? Maybe a
related and general question how to deal with the basic field logic for
"empty" and "filled" fields. Wouldn't it make sense to display labels of
empty fields?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#14843 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8XiZzhr2tRN44VUNmrRZCBAmyPRHks5roDqhgaJpZM4MkWGY
.

avatar pepperstreet
pepperstreet - comment - 21 Mar 2017

Right. There are many other related issues and the following PR
#14427
But the new "format" option seem to have issues as well:
#14837

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Mar 2017
Category Templates (site)
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Apr 2017
Priority Medium Low
Status New Confirmed
Rel_Number 0 14427
Relation Type Related to
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Apr 2017
Category Templates (site) Feature Request Templates (site)
avatar N6REJ
N6REJ - comment - 28 Apr 2017

I can confirm this issue. Values returned are either color value or "" .
I'm sure this was fixed in a previous PR.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14843.

avatar butlerps
butlerps - comment - 1 May 2017

Just come across this issue however my results are slightly different.
<field name="navbar_bg" type="color" default="#f8f8f8" keywords="transparent,initial,inherit" label="TPL_NAVBAR_BACKGROUND_COLOR_LABEL" description="TPL_NAVBAR_BACKGROUND_COLOR_DESC" />
The above allows me to enter 'transparent' and when I click save the value is stored and can be used in my template view. However the word 'transparent' is not loaded back into the template xml form so when I click 'save' again the default value of #f8f8f8 is stored.

I think I've located the problem,
file: libraries/joomla/form/fields/color.php

line 207
if (!$color || in_array($color, array('none', 'transparent'))) { $color = 'none'; } elseif ($color['0'] != '#') { $color = '#' . $color; }
the above replaces the word 'transparent' with 'none'

the following does work, but not sure if it will be good enough for you guys
if (!$color) { $color = 'none'; } elseif ($color['0'] != '#' && !in_array($color, array('transparent','initial','inherit'))) { $color = '#' . $color; }

avatar marcorensch marcorensch - reference | 9f2c9d9 - 5 May 17
avatar N6REJ
N6REJ - comment - 6 May 2017

idk if this is relevant but I discovered an issue today with it changing colors automatically...
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=''
                        />

you've 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.

avatar butlerps
butlerps - comment - 17 May 2017

Okay, so I'm extending my module so as the user can select one or more background colours to utilise the CSS linear-gradient style.
My fix above no longer works within a repeatable field, in fact as soon as you type 'transparent' into the color field, the word immediately gets replaced with "#rrggbb"

<field name="bg_color2" label="Background Color 2" description="Background colour, other options include transparent, initial &amp; inherit" type="repeatable" icon="list" > <fieldset hidden="true" name="bg_color2_modal" repeat="true"> <field name="bg_color2a" type="color" keywords="transparent,initial,inherit" default="" label="Background Color" description="" /> </fieldset> </field>
Why would this be different from my first example?

Note: just found out that format="rgba" does not appear to work inside a repeatable field. on a 'top level' color field, the colour picker appears with an alpha slider. on a color field within the repeatable fields, the color picker appears without the alpha slider
<field name="bg_color2" label="Background Color 2" description="Background colour, other options include transparent, initial &amp; inherit" type="repeatable" icon="list" keywords="transparent,initial,inherit" > <fieldset hidden="true" name="bg_color2_modal" repeat="true"> <field name="bg_color2a" type="color" keywords="transparent,initial,inherit" default="" format="rgba" label="Background Color" description="Background colour, other options include transparent, initial &amp; inherit" /> </fieldset> </field>

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Nov 2017
Status Confirmed Discussion
avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar N6REJ
N6REJ - comment - 22 May 2019

due to the insane age of this issue its now dependant on #15754 & #14427 since both of those will most likely completely change this issue.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 May 2019

@N6REJ what does this mean for this Issue?

avatar alikon
alikon - comment - 22 May 2019

hold on please
it's just another very old one but it still deserve some more investigation
...unfortunately

avatar alikon alikon - change - 12 Nov 2022
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2022-11-12 08:26:17
Closed_By alikon
Labels Added: No Code Attached Yet
Removed: ?
avatar alikon alikon - close - 12 Nov 2022
avatar alikon
alikon - comment - 12 Nov 2022

time to close it

Add a Comment

Login with GitHub to post a comment