CMS MADE SIMPLE FORGE

Extended Content Blocks

 

[#10317] Colorpicker default_value doesn't work & non-hex colorcodes are overwritten

avatar
Created By: Johan (jdkwant)
Date Submitted: Fri Nov 28 16:53:43 -0500 2014

Assigned To:
Version: 1.5
CMSMS Version: 1.11.10
Severity: Minor
Resolution: Accepted
State: Open
Summary:
Colorpicker default_value doesn't work & non-hex colorcodes are overwritten
Detailed Description:
First of all I love all these modules, just like ECB.

When I use colorpicker I have these 2 problems:

1)
In my template I have set: default_value="#ffffff". But it doesn't work. When I
open a webpage in CMS for editing, this value defaults to "#000000".

2)
When I (for example) set the colorpicker to "#ff0000". Upon save it stores the
value and works. When I reopen this page in CMSMS I can change the color.

When I (for example) set the colorpicker to "transparent". Upon save It stores
the value and works. But when I reopen this page in CMSMS this non-hex-colorcode
defaults to "#000000" in the input-box.


History

Comments
avatar
Date: 2015-07-08 18:11
Posted By: John Beatrice (mww)

I can confirm this with version 1.6 and found that the
$this->options['default_value'] is not set as the input field's value="" in the
class.ecb_tools.php file.

My fix until it can be fixed in the module. Test if the $this->value var is set,
if not, then use the  $this->options["default_value"]

For example, something like this works, but maybe not the best solution:

		if ( trim($this->value) == '' ) {
			$thisValue = $this->options["default_value"];
		} else {
			$thisValue = $this->value;
		}

        $txt .= sprintf($tmp, $this->block_name, $this->alias, $thisValue);

For those reading this, remember it is not recommended to hack/fix modules and
disqualifies you for CMSMS support....
      
Updates

Updated: 2015-01-29 08:06
resolution_id: => 6