Fix Drush bug when executing all tasks

Created on 5 February 2023, over 1 year ago
Updated 9 March 2023, over 1 year ago

When executing all tasks with Drush (drush sapi-et), the drush_search_api_execute_tasks() function is called with NULL as the server ID. However, it seems we never tested this properly and it runs into several errors.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Drush / Rules

Created by

🇦🇹Austria drunken monkey Vienna, Austria

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

Comments & Activities

  • Issue created by @drunken monkey
  • 🇦🇹Austria drunken monkey Vienna, Austria
  • 🇩🇪Germany meyerrob

    That patch solves the divison by null error for me after calling drush sapi-et

    The question is: Why is the number of tasks 0?

    The table search_api_task is always empty, even after I cleared the index with drush sapi-c - and there should be at least one task to do after that ("indexing"). As there ist no entry in search_api_task the command drush sapi-et does not do anything. The call of drush sapi-i builts the index correctly.

    Therefore it seems as if the entry in search_api_task is not properly filled, but right now I am running out of debugging time. I stumbled over this topic through another issue - normally I use the GUI to reindex my search index which works perfectly. Therefore maybe I just misunderstood the drush sapi-et...

  • Status changed to Fixed over 1 year ago
  • 🇦🇹Austria drunken monkey Vienna, Austria

    Thanks a lot for testing and reporting back, good to hear that this works as intended.
    Committed.

    Your confusion regarding the search_api_task table seems to come from a misunderstanding about that table’s contents. It doesn’t pertain at all to items that need to be indexed – that’s what search_api_item is for. “Tasks”, in the Search API, refer to changes that still need to be executed. I now added a more detailed explanation to Glossary doc page – please comment there in case this is unclear, or you have suggestions regarding the phrasing to make it easier to understand. (Or, of course, feel free to edit it right away.)

    Anyways, thanks again!

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

  • Status changed to Fixed over 1 year ago
  • So, a few things:

    1. The 7.x-1.x-dev version of the module listed on the project page was built 5 March 2022 even though the commit log shows 4 commits since then. https://git.drupalcode.org/project/search_api/-/commits/7.x-1.x

    2. Git cloning the project and plopping it onto a site completely breaks Drush with this error:

    $ ddev drush updb -y
    PHP Fatal error:  Uncaught Error: Class "view" not found in /var/www/html/web/sites/all/modules/contrib/search_api/search_api.drush.inc:731

    It seems the commit for this issue added a bunch of unrelated code for a view? It wasn't in the patch in #2. https://git.drupalcode.org/project/search_api/-/commit/d44c1b6cd8813ab39...

Production build 0.69.0 2024