Fatal error on upgrading

Created on 25 February 2025, about 1 month ago

Upgraded module, and the site went away.

PHP Fatal error: Cannot redeclare search_api_views_data() (previously declared in /home/*****/search_api/search_api.views_hooks.inc:42) in /home/*****/search_api/search_api.views.inc on line 121

I downgraded to version 8.1.37 and the site was restored. Using system 10.4.3 & php 8.1.

πŸ› Bug report
Status

Active

Version

1.38

Component

General code

Created by

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

Comments & Activities

  • Issue created by @sioux
  • πŸ‡ΊπŸ‡ΈUnited States sker101 NYC

    I had this issue earlier too only one of our sites. I ended deleting the "search_api" module folder manually and reinstalled the module via Composer and don't see the duplicated function anymore.

  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    When updating any module (or Drupal itself) via the tarball you need to make sure that you remove any files that are missing in the new version, not just extract the new version over the old one. In this case, the search_api.views.inc file was renamed, which caused this error on your site.

    In this case, simply delete search_api.views.inc when updating and the problem should be resolved.
    However, in general, please change the way you update modules to avoid similar problems in the future. The correct way of updating with tarballs is to remove the module directory completely and then extract the tarball to get the new version of the folder. But just using Composer is much preferred anyways.

  • πŸ‡ΊπŸ‡ΈUnited States mmlmitchell Spokane, WA

    Updating via composer produces same result.
    The update did not remove the search_api.views.inc file.
    Interesting variance: despite the presence of the offending file, the error did not occur on local dev enviro, only occurred on live enviro.
    Removed search_api.views.inc as suggested and the updated version (1.38) works as expected.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024