Hello,

I am currently testing/developing on the Deploy ecosystem in Drupal 8 and it seems that it is not working with search API.

I have created a basic node on a stage workspace, indexed it, it appeared on a search API view, switching workspace to live (the node does not exist on the live workspace), I got a fatal error on the search API view.

Fatal error: Call to a member function getTranslation() on null in /project/www/core/modules/node/src/NodeViewBuilder.php on line 91

I tried to index the workspace ID to add some filtering on the current workspace. After reindexing, I saw no data in the database (database index for testing/developing), and on the index status, it does not see that there is a node "0/0" for the percentage of indexed content. But the view works and I see my content when I am on the stage workspace. Really strange.

And on the search API view without using the exposed filter (fulltext search), I have the following warning:

Notice: Undefined offset: 0 in multiversion_views_post_execute() (line 240 of modules/contrib/multiversion/multiversion.module).
multiversion_views_post_execute(Object)
call_user_func_array('multiversion_views_post_execute', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('views_post_execute', Array) (Line: 1422)
Drupal\views\ViewExecutable->execute(NULL) (Line: 51)
Drupal\webprofiler\Views\TraceableViewExecutable->render() (Line: 171)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1617)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 78)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 61)
Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 140)
Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 38)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

So is there any plan on integration between search API and deploy ecosystem? Should the integration be in search API or in deploy? Or both?

Comments

Grimreaper created an issue.

drunken monkey’s picture

I don't really know anything about the Deploy project. They claim "it is designed to have a rich API which can be easily extended", so if that's true, and integration would just be something like a plugin or two, we could surely add that to the Search API module. I wouldn't want anything that interferes with other parts of the module, though.
Also:
- Deploy is still in Alpha for D8, I'd at least wait until Beta before doing this.
- Currently, my focus is on getting this module itself stable, not on integration with other projects. So I won't have any time to work on this. (And even after a stable release I'd require someone else to provide a first patch at least.)
- Also, be aware of #2682369: Fix problems with overridden config entities. I don't know how Deploy works internally, but it's possible that would also be a problem for this.

Grimreaper’s picture

Hello drunken monkey,

Thanks for the reply.

I fear it will be harder than one or two plugins.

The problem is that nodes (and precisely all supported content entities, taxonomy terms, menu links, etc.) are duplicated between workspaces. And when on a workspace you se only the nodes from this workspace.

But If you haven't tested yet, no problem, we should see later.

I will open an issue in workspace and link the two issues.

drunken monkey’s picture

The problem is that nodes (and precisely all supported content entities, taxonomy terms, menu links, etc.) are duplicated between workspaces. And when on a workspace you se only the nodes from this workspace.

That sounds like it would just need an indexed field on the entity, and a contextual filter (or condition added via an alter hook) on that field?