Update to CMSB v. 8 from 3.56

5 posts by 3 authors in: Forums > CMS Builder
Last Post: April 11   (RSS)

I am going to have to update an old, complex application for a medical institution from v. 3.56 to the most current 3.8 version. Part of the change needed on the server is to move from PHP 7.4 to 8.1.

Also, the site depends upon a number of plugins to include createPDF, csvImport, formGenerator, newsletterBuilder, QRCode Generator, reportBuilder, showHideDependedentFieldsPlus, showHideFieldsForUsers, and websiteMembership. Can anyone share any problems they may have encountered with similar upgrades?

The hospital using this application depends upon it daily, and I will need to accomplish the change over a weekend and have a working version on the following Monday. I confess to being a bit nervous.

You need to go to PHP 8.3 at a minimum, as 8.1 and 8.2 are obsolete. You'd better bite the bullet now. 

Jeff Shields
yaadev.com

Thanks very much, Dave. I've done a good number of updates for this site and others in the past. Was just wondering if there were bigtime issues going to PHP 8 or with plugins on which we depend.

Hi pgplast,

Okay, perfect. Since you've done the CMS upgrade before, the CMSB side should be straightforward.

For any custom PHP code or plugins, the most common issue is type handling. PHP 7 was more forgiving - it would silently accept `null` where a string was expected. PHP 8 throws deprecation warnings (and PHP 9 will make them errors).

An example might be @$_REQUEST['city']; if that form field wasn't submitted, it would return null.

So if you see warnings like `trim(): Passing null to parameter #1` or `strlen(): Passing null to parameter #1 ($string) of type string is deprecated`, the fix is usually one of:

// Option A: null coalesce to set a default for null values
$value = trim($record['middle_name'] ?? '');

// Option B: cast to string
$value = strlen((string) $record['notes']);

What I recommend is upgrading, then clicking through all the pages and checking the CMS Developer for any errors.

Let me know if you run into anything specific, and we can help you sort it out.

Dave Edis - Senior Developer
interactivetools.com