In drupal 8 Glossary mode is not working for taxonomy.Its working for content very well but not working for taxonomy. its showing ajax error :
I am using latest drupal :
Drupal-8.1.7

AjaxError:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /drupal8/admin/structure/views/view/test_views/preview/page_1
StatusText: OK
ResponseText:
( ! ) Fatal error: Unsupported operand types in C:\wamp\www\drupal8\core\modules\views\src\ManyToOneHelper.php on line 301
Call Stack
#TimeMemoryFunctionLocation
10.0010145168{main}( )..\index.php:0
20.01901319152Drupal\Core\DrupalKernel->handle( )..\index.php:19
30.09903153984Stack\StackedHttpKernel->handle( )..\DrupalKernel.php:628
40.09903154040Drupal\Core\StackMiddleware\NegotiationMiddleware->handle( )..\StackedHttpKernel.php:23
50.09903154392Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle( )..\NegotiationMiddleware.php:50
60.09903154608Drupal\page_cache\StackMiddleware\PageCache->handle( )..\ReverseProxyMiddleware.php:47
70.10003154912Drupal\page_cache\StackMiddleware\PageCache->pass( )..\PageCache.php:77
80.10003154952Drupal\Core\StackMiddleware\KernelPreHandle->handle( )..\PageCache.php:98
90.16607320568Drupal\Core\StackMiddleware\Session->handle( )..\KernelPreHandle.php:47
100.18307670936Symfony\Component\HttpKernel\HttpKernel->handle( )..\Session.php:57
110.18307671448Symfony\Component\HttpKernel\HttpKernel->handleRaw( )..\HttpKernel.php:62
120.389014227088call_user_func_array:{C:\wamp\www\drupal8\vendor\symfony\http-kernel\HttpKernel.php:139}
( )..\HttpKernel.php:139
130.389014227200Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}( )..\HttpKernel.php:139
140.389014227328Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext( )..\EarlyRenderingControllerWrapperSubscriber.php:97
150.390014239312Drupal\Core\Render\Renderer->executeInRenderContext( )..\EarlyRenderingControllerWrapperSubscriber.php:124
160.390014239584Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}( )..\Renderer.php:574
170.390014239616call_user_func_array:{C:\wamp\www\drupal8\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php:123}
( )..\EarlyRenderingControllerWrapperSubscriber.php:123
180.390014239984Drupal\Core\Controller\FormController->getContentResult( )..\EarlyRenderingControllerWrapperSubscriber.php:123
190.397014641488Drupal\Core\Form\FormBuilder->buildForm( )..\FormController.php:74
200.566021638520Drupal\Core\Form\FormBuilder->processForm( )..\FormBuilder.php:314
210.575021790280Drupal\Core\Form\FormBuilder->rebuildForm( )..\FormBuilder.php:619
220.575021790280Drupal\Core\Form\FormBuilder->retrieveForm( )..\FormBuilder.php:362
230.575021791832call_user_func_array:{C:\wamp\www\drupal8\core\lib\Drupal\Core\Form\FormBuilder.php:512}
( )..\FormBuilder.php:512
240.575021792152Drupal\views_ui\ViewFormBase->buildForm( )..\FormBuilder.php:512
250.575021792152Drupal\Core\Entity\EntityForm->buildForm( )..\ViewFormBase.php:41
260.575021792944Drupal\views_ui\ViewPreviewForm->form( )..\EntityForm.php:115
270.575021799184Drupal\views_ui\ViewUI->renderPreview( )..\ViewPreviewForm.php:60
280.582021834712Drupal\views\ViewExecutable->preview( )..\ViewUI.php:602
290.600022143776Drupal\views\Plugin\views\display\DisplayPluginBase->preview( )..\ViewExecutable.php:1647
300.600022144240Drupal\views\ViewExecutable->render( )..\DisplayPluginBase.php:2389
310.600022144544Drupal\views\ViewExecutable->execute( )..\ViewExecutable.php:1440
320.600022145168Drupal\views\ViewExecutable->build( )..\ViewExecutable.php:1377
330.602022155256Drupal\views\ViewExecutable->_buildArguments( )..\ViewExecutable.php:1253
340.606022336480Drupal\views\Plugin\views\argument\StringArgument->query( )..\ViewExecutable.php:1100
350.606022338176Drupal\views\ManyToOneHelper->addFilter( )..\StringArgument.php:225

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

harish Patel created an issue. See original summary.

harishpatel86’s picture

Issue summary: View changes
Lendude’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.1.x-dev
Component: taxonomy data » views.module

Didn't try to reproduce, moved to the right queue.

Lendude’s picture

Status: Active » Needs review
Issue tags: +Needs tests

Still didn't try to reproduce, but just looking at the code that throws the error, $this->placeholders never gets set and never gets used anywhere in the project, so if you get to this bit of logic this will always be NULL, so that will always fail.

Since this variable is never used anywhere or initialised in the class, lets just remove it.

This would obviously need tests.

Lendude’s picture

Now with the patch....

dawehner’s picture

There is no single place in the codebase which refers to ->placeholders, so it is safe to remove the usage in that context.

Lendude’s picture

Status: Needs review » Needs work

back to needs work for tests

harishpatel86’s picture

Now ,Patch is working fine.Please add this patch in views in latest version

Thanks a lot

pingwin4eg’s picture

Version: 8.1.x-dev » 8.2.x-dev
Status: Needs work » Reviewed & tested by the community

The patch fixes the same bug in 8.2.x. Since it's more recent version I changed the issue meta (I had no chance to test it in 8.3.x).

Lendude’s picture

Status: Reviewed & tested by the community » Needs work

This still needs tests.

Lendude’s picture

Here is a test for this. It's a bit bare boned but it gets the job done.

The last submitted patch, 11: taxonomy_glossary-2778411-11-TEST_ONLY.patch, failed testing.

dawehner’s picture

index 09accee..a3c4834 100644
--- a/core/modules/views/src/ManyToOneHelper.php

--- a/core/modules/views/src/ManyToOneHelper.php
+++ b/core/modules/views/src/ManyToOneHelper.php

+++ b/core/modules/views/src/ManyToOneHelper.php
@@ -298,7 +298,7 @@ public function addFilter() {

@@ -298,7 +298,7 @@ public function addFilter() {
         }
         $placeholders = array(
           $placeholder => $value,
-        ) + $this->placeholders;
+        );
         $this->handler->query->addWhereExpression($options['group'], "$field $operator", $placeholders);
       }
       else {

We do have a generic test for this many to one filter, so having tests there would be kind of preferable, from a discoverability point of view.

Lendude’s picture

Status: Needs review » Closed (duplicate)

Closing this as a duplicate of #2630692: Fatal error when creating taxonomy term glossary view since that is the older issue and had some work done on it previously.