Commit 7fb9da51 authored by skaught's avatar skaught Committed by skaught
Browse files

Issue #3262520 by SKAUGHT: Solr with empty index throws error

parent e4eb2f6e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Drupal\facets\FacetInterface;
use Drupal\facets\Processor\PreQueryProcessorInterface;
use Drupal\facets\Processor\ProcessorPluginBase;
use Drupal\facets\Processor\BuildProcessorInterface;
use Drupal\Core\Field\TypedData\FieldItemDataDefinition;

/**
 * Provides a processor that adds all values for selected date.
@@ -81,7 +82,7 @@ class DatepickerProcessor extends ProcessorPluginBase implements PreQueryProcess
      'created',
      'changed'
    ];
    if (in_array($field->getFieldDefinition()->getFieldStorageDefinition()->getType(), $allowed_types)) {
    if ($field instanceof FieldItemDataDefinition && in_array($field->getFieldDefinition()->getFieldStorageDefinition()->getType(), $allowed_types)) {
      return TRUE;
    }
    return FALSE;
+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Drupal\facets\FacetInterface;
use Drupal\facets\Processor\PreQueryProcessorInterface;
use Drupal\facets\Processor\ProcessorPluginBase;
use Drupal\facets\Processor\BuildProcessorInterface;
use Drupal\Core\Field\TypedData\FieldItemDataDefinition;

/**
 * Provides a processor that adds all values between an min and max range.
@@ -94,7 +95,7 @@ class RangeDatepickerProcessor extends ProcessorPluginBase implements PreQueryPr
      'created',
      'updated'
    ];
    if (in_array($field->getFieldDefinition()->getFieldStorageDefinition()->getType(), $allowed_types)) {
    if ($field instanceof FieldItemDataDefinition && in_array($field->getFieldDefinition()->getFieldStorageDefinition()->getType(), $allowed_types)) {
      return TRUE;
    }
    return FALSE;