Fix Gravity Forms Highrise Add-on for WordPress and PHP8

- Code Snippets, PHP, WordPress

Highrise has long been a popular CRM from the great people at Basecamp. If you are a Highrise CRM user you may already know that as of 2018 they have stopped accepting new customers and have transitioned to specifically legacy support.

For any of you WordPress users who love the Gravity Forms plugin as much as we do, you may have relied on their Highrise add-on to sync entry submissions to the CRM. Unfortunately, Gravity Forms stopped supporting this add-on in 2019. For many the add-on has continued to operate, but we have recently been receiving reports from clients about issues with PHP8.

We reached out to Gravity Forms, but they aren’t allocating resources towards this and Google didn’t have any other available integrations. We decided to dive into the code to see what the deal was and it turns out it’s an easy fix.

After upgrading to PHP8 you may see the below error:

PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /nas/content/live/usmangroupstg/wp-content/plugins/gravityformshighrise/includes/Highrise/HighriseEntity.php:281

To resolve this error, simply replace line 281 of the HighriseEntity.php file with the below snippet:
if ( count( (array)$xml_object->{'tag'} ) > 0 ) {

That’s it!

For any other WordPress troubleshoot help, toss us an email: [email protected].