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

PHP8 Errors #277

Open
dsenalik opened this issue Jul 26, 2022 · 1 comment
Open

PHP8 Errors #277

dsenalik opened this issue Jul 26, 2022 · 1 comment

Comments

@dsenalik
Copy link

dsenalik commented Jul 26, 2022

Under PHP 8.0 when accessing /update.php
TypeError: PDOStatement::fetchAll(): Argument #2 must be of type int, string given in PDOStatement->fetchAll() (line 2303 of .../includes/database/database.inc).

This error comes from line 449 of tripal_elasticsearch.module where fetchCol() is passed a string instead of an integer.

function tripal_elasticsearch_block_info() {
  ...
  // Define blocks for table search forms.
  $sql = "SELECT index_name FROM {tripal_elasticsearch}";
  $index_names = db_query($sql)->fetchCol('index_name');
  ...

Only one column is returned, the simple fix would be to change this to

  $index_names = db_query($sql)->fetchCol(0);

or

  $index_names = db_query($sql)->fetchCol();
@dsenalik
Copy link
Author

dsenalik commented Sep 21, 2022

Additional error encountered when unpublishing orphan nodes, exception defined as $e but referenced as $exception which is of course null:

WD php: Error: Call to a member function getMessage() on null in tripal_elasticsearch_bundle_delete_orphans()[error]
(line 1154 of .../sites/all/modules/tripal_elasticsearch/tripal_elasticsearch.module).

Adding the fix for this to pull request with e783e2b

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

No branches or pull requests

1 participant