Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Add a temporary fix for the storage config. #7

Open
wants to merge 2 commits into
base: 8.x-1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Entity/Query/Sparql/SparqlCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,16 @@ public function condition($field = NULL, $value = NULL, $operator = NULL, $lang
$field_name_parts = explode('.', $field);
$field = $field_name_parts[0];
$column = isset($field_name_parts[1]) ? $field_name_parts[1] : $this->fieldHandler->getFieldMainProperty($this->query->getEntityTypeId(), $field);

// @todo: This should maybe throw an exception instead. That blocks the
// creation of new fields though because the field storage config class
// validated the form by checking counting the values in the database.
// For now, return without adding the condition in this case.
// @see: \Drupal\field_ui\Form\FieldStorageConfigEditForm::validateCardinality
if (empty($this->fieldHandler->getFieldPredicates($this->query->getEntityTypeId(), $field, $column))) {
return $this;
}

$this->conditions[] = [
'field' => $field,
'value' => $value,
Expand Down