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

Commit

Permalink
Add a temporary fix for the storage config.
Browse files Browse the repository at this point in the history
  • Loading branch information
idimopoulos committed Sep 19, 2017
1 parent 410b0d7 commit 0038fb4
Showing 1 changed file with 10 additions and 0 deletions.
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 (!$this->fieldHandler->hasFieldPredicate($this->query->getEntityTypeId(), $field, $column, $this->entityBundle)) {
return $this;
}

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

0 comments on commit 0038fb4

Please sign in to comment.