When you export a search_api server definition to a feature it does not list the module that provides the storage engine as a dependency. This is particularly problematic when the feature is used in an installation profile as it causes the installation to fail. In both circumstances, if the relevant module is not already enabled it will fail with the following error:
SearchApiException: Search server with machine name site_db specifies illegal service class search_api_db_service. in SearchApiServer->ensureProxy() (line 133 of search_api/includes/server_entity.inc).
Continued from #1593312: SearchApiException: Search server with machine name site_db specifies illegal service class search_api_db_service.
Comment | File | Size | Author |
---|---|---|---|
#3 | search_api-n1600986-3.patch | 1.4 KB | DamienMcKenna |
#1 | search_api-n1600986.patch | 1.41 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaThis patch resolves the problem. It uses hook_features_export_alter() to run through the list of exported server specifications, loads each one and then works out what module is responsible for generating it - if the module isn't in the dependencies list it is added.
Comment #2
drunken monkeyWow, thanks a bunch!
I knew this had to be possible somehow. Great that you found and implemented that!
Could someone with that problem please verify that the patch works as intended?
Comment #3
DamienMcKennaThis patch fixes the bug from #1630130: Warning: ksort() expects parameter 1 to be array, string given in search_api_features_export_alter() - I had a #facepalm-worthy bug regarding the ksort() line at the end of the patch.
Comment #4
drunken monkeyThe usual enthusiasm regarding the testing of patches …
But OK, I'll just take your word that the patch works. ;)
Committed. Thanks a lot for your work!