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 method_exists() PHP 8 error #3826

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Fix method_exists() PHP 8 error #3826

merged 1 commit into from
Aug 24, 2022

Conversation

clayliddell
Copy link
Contributor

@clayliddell clayliddell commented Aug 24, 2022

This ensures that the indexer service exists before attempting to check whether it has a specific method.

  • Test coverage exists
  • Documentation exists

QA Steps

This will need to be tested on a site running php 8.

  • Navigate to /api/1
  • Ensure you do not see the following error:
TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in method_exists() (line 307 of /mnt/www/html/datamedicaiddev/docroot/modules/contrib/dkan/modules/common/src/Storage/AbstractDatabaseTable.php) #0 /mnt/www/html/datamedicaiddev/docroot/modules/contrib/dkan/modules/common/src/Storage/AbstractDatabaseTable.php(307): method_exists(NULL, 'modifySchema')
#1 /mnt/www/html/datamedicaiddev/docroot/modules/contrib/dkan/modules/common/src/Storage/AbstractDatabaseTable.php(273): Drupal\common\Storage\AbstractDatabaseTable->tableCreate('jobstore_drupal...', Array)
#2 /mnt/www/html/datamedicaiddev/docroot/modules/contrib/dkan/modules/common/src/Storage/AbstractDatabaseTable.php(83): Drupal\common\Storage\AbstractDatabaseTable->setTable() 

@janette janette merged commit 63c4406 into 2.x Aug 24, 2022
thierrydallacroce pushed a commit that referenced this pull request Sep 1, 2022
@janette janette deleted the fix-method-exists-php-8-error branch May 19, 2023 14:25
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.

None yet

2 participants