implode(): Passing glue string after array is deprecated in PHP 7.4

Created on 16 March 2022, over 2 years ago
Updated 22 September 2023, 9 months ago

Problem/Motivation

After upgrading to PHP 7.4 we're seeing this message on pages where we have used a color field:

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in color_field_hex2rgba() (line 137 of /code/sites/all/modules/contrib/color_field/color_field.module).

The code in color_field_hex2rgba() is using a legacy method of calling the implode() function which has been deprecated in PHP 7.4 and will be removed in PHP 8.0.

https://www.php.net/manual/en/function.implode.php#refsect1-function.imp...

Proposed resolution

The fix is to swap the order of parameters so the separator is listed first. A patch file is attached.

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom kewesley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024