The import form makes assumptions that fields will be populated

Created on 17 May 2025, 18 days ago

Problem/Motivation

Seems the import form makes assumptions on the available fields

Steps to reproduce

1. Enable the module
2. Go to admin/config/search/search-api-synonyms/import
3. Don't upload a file
4. Import

TypeError: Drupal\search_api_synonym\Plugin\search_api_synonym\import\Solr::parseFile(): Argument #1 ($file) must be of type Drupal\file\Entity\File, string given, called in /var/www/html/web/modules/contrib/search_api_synonym/src/Form/SynonymImportForm.php on line 219 in Drupal\search_api_synonym\Plugin\search_api_synonym\import\Solr->parseFile() (line 26 of modules/contrib/search_api_synonym/src/Plugin/search_api_synonym/import/Solr.php).

Proposed resolution

Fail gracefully/add validation/make fields mandatory

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom aaron.ferris

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024