Problem/Motivation

Deprecated function: Return type of Drupal\search_api\Query\ResultSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 11 of modules/contrib/search_api/src/Query/ResultSet.php).

Steps to reproduce

Install module on site running on PHP 8.1.

Proposed resolution

Resolve deprecation.

Issue fork search_api-3257456

Command icon 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

markdorison created an issue. See original summary.

markdorison’s picture

Status: Active » Closed (duplicate)

Already resolved in #3253738: PHP 8.1 Deprecations!

sunita.sharma’s picture

This issue seems to be closed. but I am not able to figure out what is the solution. because everything is striked out.. Please help.. I have tried to apply the patch in issue #3253738 but it doesn't work.. ends up giving more errors.

mmjvb’s picture

Fixed in https://www.drupal.org/project/search_api/issues/3253738#comment-14655266

As suggested there, create a new issue referring to #3253738 when running into problems with the fixed version. Your problems are not considered the same, despite having the same symptoms.