Problem/Motivation
When using remote entities, e.g. on a cross-site index, the processor will trigger exceptions, because the remote entity can't be retrieved:
Drupal\search_api\SearchApiException: The datasource with ID '192q7p--entity:node' could not be retrieved for index 'Main'. in Drupal\search_api\Entity\Index->getDatasource() (line 369 of modules/contrib/search_api/src/Entity/Index.php).
Stack trace:
#0 modules/contrib/search_api/src/Entity/Index.php(879): Drupal\search_api\Entity\Index->getDatasource()
#1 modules/contrib/search_api/src/Entity/Index.php(858): Drupal\search_api\Entity\Index->loadItemsMultiple()
#2 modules/contrib/search_api/src/Item/Item.php(203): Drupal\search_api\Entity\Index->loadItem()
#3 modules/contrib/search_api_attachments/src/Plugin/search_api/processor/FilesExtractor.php(202): Drupal\search_api\Item\Item->getOriginalObject()
Steps to reproduce
One possible scenario, very roughly: Have at least two Drupal installations write to the same index. Set up Search API Attachments for at least one of the Drupals. In a full text search view, search for a term that will show results from the one of the other Drupals.
Proposed resolution
The processor doesn't have to work for remote entities, any required processing can/will be setup at the source. Catch the exception and return. This might seem odd, but it seems to be the "official" solution, as you can see for example here as well as in other processors shipped with Search API.
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork search_api_attachments-3468104
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
feyp commentedComment #4
izus commentedthis is now merged
thanks
Comment #6
izus commentedwill be there when 10.0.4 will be released