PHP 7.4 Errors

6 posts by 3 authors in: Forums > CMS Builder
Last Post: April 15, 2020   (RSS)

Hey Mark,

Thanks for sharing the error log entries, it helped me to track down the issue quickly.

I found the source of the issue, arrays that use curly braces are deprecated in version 7.4 of PHP, and there is a line of code in the function _showCheckbox that uses them. 

I've added a fix to the codebase of CMS Builder so that the issue will be resolved in the next release.

You can manually patch the issue in your version CMS Builder by editing [CMSB Directory]/lib/menus/default/edit_functions.php line 794 and change it from this:

  else if ($record && @$record{$fieldSchema['name']})            { $checkedAttr = 'checked="checked"'; }

to this:

  else if ($record && !empty($record[$fieldSchema['name']]))     { $checkedAttr = 'checked="checked"'; }

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By mark99 - February 26, 2020

Yep that seems to work, thanks Greg.

By depdesign - April 15, 2020

Hi Greg,

This solution also help me within the cms to remove the errors, but, I also see a similar error on the "Simple Forum" now.

This is what I see on the forum:

Deprecated: Array and string offset access syntax with curly braces is deprecated in /cms/cmsAdmin/3rdParty/HTMLPurifier/HTMLPurifier.standalone.php on line 3941 Deprecated: Array and string offset access syntax with curly braces is deprecated in /cms/cmsAdmin/3rdParty/HTMLPurifier/HTMLPurifier.standalone.php on line 14584 Deprecated: Array and string offset access syntax with curly braces is deprecated in /cms/cmsAdmin/3rdParty/HTMLPurifier/HTMLPurifier.standalone.php on line 21109 Deprecated: Array and string offset access syntax with curly braces is deprecated in /cms/cmsAdmin/3rdParty/HTMLPurifier/HTMLPurifier.standalone.php on line 21109

- Dan

Dan Perez
Attachments:

screen-sample.jpg

Hey Dan,

Thanks for letting us know about this one. The HTML purifier library that CMS Builder uses has three instances were it uses curly braces which are depreciated in version 7.4 of PHP. I've upgraded CMS Builder to use the latest version of the library, so this issue will be resolved in the next release. 

You can manually patch your version of CMS Builder as follows:

  1. Make a backup of your current CMS builder directory
  2. Download the zip file attached to this post with the latest version of the HTML purifier library.
  3. Navigate to your cmsb/3rdparty/HTMLPurifier directory and overwrite it with the all contents of the directory htmlpurifier-4.12.0-standalone in the zip file.
    1. Both directories should contain a file called HTMLPurifier.standalone.php and a subdirectory called standalone (see attached screenshot for example).

If you'd prefer, I can provide you with line by line instructions to update the current version of the HTML purifier library instead. 

Greg Thomas







PHP Programmer - interactivetools.com

By depdesign - April 15, 2020

Hi Greg,

Thanks for the rapid response!  The update worked!

Dan

Dan Perez