Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP 8 compatibility issues #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

omarabuhussein
Copy link

@omarabuhussein omarabuhussein commented May 23, 2023

Before

Trying to create new event on PHP 8 sites throws an error:

image

After

Event creation page works fine:

image

Technical notes

This PR is built in top of the other PR here: #53 that regenerates the civix file so it can work with PHP 8 sites, but this is not the whole story, where when trying to access the event creation page it throws an error as can be seen on the "before" section, and the following error will show in logs:

Error: Non-static method CRM_Gotowebinar_Utils::isCiviCRMVersion47() cannot be called statically in CRM_Gotowebinar_Utils::getItem() (line 127 of /var/www/default/htdocs/httpdocs/sites/all/civicrm_extensions/uk.co.vedaconsulting.gotowebinar/CRM/Gotowebinar/Utils.php)

which happen because some parts of this extension code tries to access this method CRM_Gotowebinar_Utils ::isCiviCRMVersion47 statically , but the method itself is not a static method, which is no longer allowed in PHP 8.

In this PR I changed this method along with the rest of the methods inside CRM_Gotowebinar_Utils class to be static, given they are all called statically within this extension code.

I also removed a call for a class that does not exist in CiviCRM codebase CRM_Finance_BAO_Import_ValidateException and replaced it with CRM_Core_Exception.

@mlutfy
Copy link

mlutfy commented Jun 28, 2023

I removed the "reviewed" status from civicrm.org, so that people do not accidentally break their installation (https://civicrm.org/extensions/gotowebinar-integration-civicrm-events) - I'll be happy to add it back when a new release it tagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants