Incompatible with recent search_api 8.x-1.35 release

Created on 17 June 2024, 6 months ago
Updated 21 June 2024, 6 months ago

Problem/Motivation

When updating to drupal/search_api 8.x-1.35 release your website will throw following fatal error:

PHP message: PHP Fatal error:  Declaration of Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::__sleep() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__sleep(): array in /var/www/html/docroot/modules/contrib/elasticsearch_connector/src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php on line 1236

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Closed: duplicate

Version

7.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany IT-Cru Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @IT-Cru
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Sweetchuck Budapest

    I can confirm.

  • ๐Ÿ‡ญ๐Ÿ‡บHungary Sweetchuck Budapest
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States albertho425

    I got the same message:

    [success] Finished performing updates.
    PHP Fatal error: Declaration of Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::__sleep() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__sleep(): array in /var/www/html/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php on line 5077

    Fatal error: Declaration of Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::__sleep() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__sleep(): array in /var/www/html/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php on line 5077
    [warning] Drush command terminated abnormally.
    Failed to run drush updb: exit status 1
    albertho ~/Documents/uw-deohs-web [06-27] $ ddev drush ws
    PHP Fatal error: Declaration of Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::__sleep() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__sleep(): array in /var/www/html/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php on line 5077

    Fatal error: Declaration of Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::__sleep() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__sleep(): array in /var/www/html/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php on line 5077
    [warning] Drush command terminated abnormally.
    Failed to run drush ws: exit status 1
    albertho ~/Documents/uw-deohs-web [06-27] $ ddev drush cr
    PHP Fatal error: Declaration of Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::__sleep() must be compatible with Drupal\search_api\Backend\BackendPluginBase::__sleep(): array in /var/www/html/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php on line 5077

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia yovince Melbourne

    I am experiencing the same issue.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia kim.pepper ๐Ÿ„โ€โ™‚๏ธ๐Ÿ‡ฆ๐Ÿ‡บSydney, Australia

    See the fix in Search API OpenSearch ๐Ÿ› Handle missing return type in __wakeup() Fixed

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance berramou

    I attach a patch that fix this issue.

  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance berramou
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia yovince Melbourne

    #7 works for me.

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland sokru

    I think we need to add the return type also in __wakeup() like in ๐Ÿ› Handle missing return type in __wakeup() Fixed

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance berramou

    It works for me without implementation __wakeup(), it doesn't seems necessary because the parent BackendPluginBase already implementing __wakeup method.

      /**
       * Implements the magic __wakeup() method.
       *
       * Reloads the server entity.
       */
      public function __wakeup(): void {
        parent::__wakeup();
    
        if ($this->serverId) {
          $this->server = Server::load($this->serverId);
          $this->serverId = NULL;
        }
      }
    
  • Status changed to Closed: duplicate 6 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland sokru

    This is already committed on ๐Ÿ“Œ Add a return type hint to SearchApiElasticsearchBackend::__sleep() Fixed , I'll make a new release soon.

Production build 0.71.5 2024