Problem/Motivation
This module is not compatible with PHP 8 due to missing visibility on the cron controller and calling non-static methods against it.
[error] Error: Non-static method Drupal\quickbooks_api\Controller\QBOCronController::qboRunCron() cannot be called statically in quickbooks_api_cron() (line 58 of /srv/web/modules/contrib/quickbooks_api/quickbooks_api.module) #0 [internal function]: quickbooks_api_cron()
#1 /srv/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('quickbooks_api_...', Array)
#2 /srv/web/core/lib/Drupal/Core/Cron.php(250): Drupal\Core\Extension\ModuleHandler->invoke('quickbooks_api', 'cron')
Steps to reproduce
Run PHP 8, then cron.
Proposed resolution
Rewrite the cron controller into a service, use dependency injection properly for access to things like Drupal State, Config, etc.
Remaining tasks
See merge request.
User interface changes
None.
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | php8.patch | 11.59 KB | alexandersluiter |
Issue fork quickbooks_api-3279962
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #8
alexandersluiter commentedThe module does not have a proper 2.x-dev branch to build a merge request off. This is a patch that works against 2.0.0-rc1 that replaces the cron controller with a dependency injected service and is PHP 8 compatible.
Comment #9
alexandersluiter commentedFirst patch is completely broken. Cron service in wrong location. Here's the working one.
Comment #10
jdhildeb commentedThank you, @alexandersluiter for this fix. I've applied your patch after encountering the broken cron job.
I'm updating the subject of this issue to make this patch easier to find.
Comment #11
alexandersluiter commented