Skip to content
Snippets Groups Projects
Commit 94f3f368 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1038030 by yched: Fixed More accurate error handling in...

Issue #1038030 by yched: Fixed More accurate error handling in EntityFieldQuery : non-existing field.
parent 3588d097
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -651,7 +651,11 @@ public function entityCondition($name, $value, $operator = NULL) {
*/
public function fieldCondition($field, $column = NULL, $value = NULL, $operator = NULL, $delta_group = NULL, $language_group = NULL) {
if (is_scalar($field)) {
$field = field_info_field($field);
$field_definition = field_info_field($field);
if (empty($field_definition)) {
throw new EntityFieldQueryException(t('Unknown field: @field_name', array('@field_name' => $field)));
}
$field = $field_definition;
}
// Ensure the same index is used for fieldConditions as for fields.
$index = count($this->fields);
......@@ -753,7 +757,11 @@ public function entityOrderBy($name, $direction = 'ASC') {
*/
public function fieldOrderBy($field, $column, $direction = 'ASC') {
if (is_scalar($field)) {
$field = field_info_field($field);
$field_definition = field_info_field($field);
if (empty($field_definition)) {
throw new EntityFieldQueryException(t('Unknown field: @field_name', array('@field_name' => $field)));
}
$field = $field_definition;
}
// Save the index used for the new field, for later use in field storage.
$index = count($this->fields);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment