Avoid division by zero

Created on 29 September 2023, 9 months ago
Updated 26 March 2024, 3 months ago

Problem/Motivation

When adding a new index to Search API, at /admin/config/search/search-api/index/nuclia_index, a fatal PHP error happen:

DivisionByZeroError: Division by zero in Drupal\search_api_nuclia\Plugin\search_api\backend\SearchApiNucliadbBackend->search() (line 393 of /var/www/html/web/modules/custom/search_api_nuclia/src/Plugin/search_api/backend/SearchApiNucliadbBackend.php).

Steps to reproduce

Add a new server and a new index.

Proposed resolution

Check before dividing.

Remaining tasks

No remaining tasks.

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇭🇺Hungary Aron Novak Hungary, Budapest

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024