When trying to upgrade to Search API 1.33, the Solr Document Datasource has issues:
Drupal\Component\Plugin\Exception\PluginNotFoundException while adding Views handlers for field Solr Document » FIELD_NAME on index INDEX: The "text" plugin does not exist. Valid plugin IDs for Drupal\Core\TypedData\TypedDataManager are: …
It seems that issue is caused by the change in _search_api_views_get_handlers().
The exceptions are triggered by the new call is_a($definition?->getClass(), EntityReferenceItem::class, TRUE) .
It seems that check is too early. Obviously some custom field types come first and cause such exceptions because the fallback types text, date , … aren’t loaded yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Bildschirmfoto 2024-04-05 um 17.35.33.png | 297.4 KB | mkalkbrenner |
| #2 | 3438940.patch | 1.13 KB | mkalkbrenner |
Issue fork search_api-3438940
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 #2
mkalkbrennerThe issue is caused by #3394367: Not all fields that have a target_type setting are entity references.
That patch tries to avoid a
Drupal\Component\Plugin\Exception\PluginNotFoundException.But the new
$definition->getClass()that has been added before the critical section could lead to aDrupal\Component\Plugin\Exception\PluginNotFoundExceptionitself!Comment #3
mkalkbrennerComment #4
mkalkbrennerComment #5
mkalkbrennerComment #8
drunken monkeyCreated an MR with your patch and some minor style changes. (Testing of patches is not working anymore, we now need to use MRs – a bit funny, I know.) Would be great to get some quick feedback on whether this still worked for you, then I’ll merge and create release 1.34 – hopefully without any critical bugs this time.
And then we’ll either keep this open or create a follow-up to develop a proper fix.
Comment #10
drunken monkeyAs discussed on Slack this seems to not be a bug in this module after all, but one in the Solr module that was simply uncovered by the recent change in this one. I created a follow-up issue #3439023: Invalid types "text" and "date" specified in SolrFieldDefinition data defintions in the Solr module but will still create a new release of this module with the workaround in the MR to keep more people from being affected.
So, merged. Thanks again!