Jump to content

FieldtypeColor


kixe
 Share

Recommended Posts

Hey @kixe

I'm using Version 1.2.0 on PW 3.0.229 with PHP 8.1.19 and getting the following error:

Deprecated: hexdec(): Passing null to parameter #1 ($hex_string) of type string is deprecated in .../site/modules/FieldtypeColor/FieldtypeColor.module:85

1411965530_2024-06-0609_27_22-HeroSlider_VIEREGGDesignGmbHMozillaFirefox.thumb.png.3d6b92a0ed6cd3d3e20474cd8cbe00e5.png

The null coalescing operator is working for me in line 85:

	public function sleepValue(Page $page, Field $field, $value) {
		return hexdec($value ?? '');
	}

Can you fix this?

Many greets!

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

I'm getting this error when trying to access the field, or any page that is using the field. 

"Expecting Hex color string (length 6 or 8 digits) with optional leading '#'"

I believe it's because I first selected hex output and later changed it to rgba.

The error is basically breaking every page where the field is used.

Some more information. Temporarily editing out line #84 in FieldtypeColor.module allowed me to fix the defaul value that was crashing the module. It seems that if default value has an alpha value it will cause a crash.

But now I'm running into an another issue. Allowing user to select alpha causes this error:

"InputfieldColor: Submitted value: rgb(0, 0, 0) does not match required pattern: /#?[a-fA-F\d]{6}/."

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...