diff --git a/includes/entity.inc b/includes/entity.inc index f363c31..e3bb366 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -606,7 +606,7 @@ class EntityFieldQuery { * dependent on $operator. * @param $operator * Possible values: - * - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These + * - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These * operators expect $value to be a literal of the same type as the * column. * - 'IN', 'NOT IN': These operators expect $value to be an array of @@ -724,7 +724,7 @@ class EntityFieldQuery { * element in the array is dependent on $operator. * @param $operator * Possible values: - * - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These + * - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These * operators expect $value to be a literal of the same type as the * column. * - 'IN', 'NOT IN': These operators expect $value to be an array of @@ -789,7 +789,7 @@ class EntityFieldQuery { * array is dependent on $operator. * @param $operator * Possible values: - * - '=', '!=', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These + * - '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These * operators expect $value to be a literal of the same type as the * column. * - 'IN', 'NOT IN': These operators expect $value to be an array of diff --git a/modules/field/tests/field_test.storage.inc b/modules/field/tests/field_test.storage.inc index 3ca322d..c677b94 100644 --- a/modules/field/tests/field_test.storage.inc +++ b/modules/field/tests/field_test.storage.inc @@ -287,6 +287,9 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor case '<=': case '>': case '>=': + if ($operator == '!=') { + $operator = '<>'; + } eval('$match = $match && ' . $row->{$column} . ' ' . $operator . ' '. $value); break; case 'IN': diff --git a/modules/simpletest/tests/entity_query.test b/modules/simpletest/tests/entity_query.test index 0fe8106..fb95518 100644 --- a/modules/simpletest/tests/entity_query.test +++ b/modules/simpletest/tests/entity_query.test @@ -722,7 +722,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { $query = new EntityFieldQuery(); $query ->entityCondition('entity_type', 'test_entity_bundle_key') - ->propertyCondition('ftid', 3, '!='); + ->propertyCondition('ftid', 3, '<>'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), @@ -732,7 +732,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { ), t('Test the "not equal to" operation on a property.')); $query = new EntityFieldQuery(); - $query->fieldCondition($this->fields[0], 'value', 3, '!='); + $query->fieldCondition($this->fields[0], 'value', 3, '<>'); $this->assertEntityFieldQuery($query, array( array('test_entity_bundle_key', 1), array('test_entity_bundle_key', 2), @@ -1088,7 +1088,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { $query = new EntityFieldQuery(); $query ->entityCondition('entity_type', 'test_entity', '=') - ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!='); + ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), ), t('Test with a language meta condition.')); @@ -1115,7 +1115,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { $query ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group') - ->fieldLanguageCondition($this->fields[0], 'en', '!=', NULL, 'group'); + ->fieldLanguageCondition($this->fields[0], 'en', '<>', NULL, 'group'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), ), t('Test with a grouped language meta condition.')); @@ -1124,7 +1124,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { $query ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', NULL, 'group') - ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', NULL, 'group'); + ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', NULL, 'group'); $this->assertEntityFieldQuery($query, array(), t('Test with a grouped language meta condition (empty result set).')); // Test delta and language grouping. @@ -1133,7 +1133,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language') - ->fieldLanguageCondition($this->fields[0], 'en', '!=', 'delta', 'language'); + ->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language'); $this->assertEntityFieldQuery($query, array( array('test_entity', 1), ), t('Test with a grouped delta + language meta condition.')); @@ -1143,7 +1143,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language') - ->fieldLanguageCondition($this->fields[0], 'en', '!=', 'delta', 'language'); + ->fieldLanguageCondition($this->fields[0], 'en', '<>', 'delta', 'language'); $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, delta condition unsatisifed).')); $query = new EntityFieldQuery(); @@ -1151,7 +1151,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '<', 'delta', 'language') - ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', 'delta', 'language'); + ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', 'delta', 'language'); $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, language condition unsatisifed).')); $query = new EntityFieldQuery(); @@ -1159,7 +1159,7 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase { ->entityCondition('entity_type', 'test_entity', '=') ->fieldCondition($this->fields[0], 'value', 0, '=', 'delta', 'language') ->fieldDeltaCondition($this->fields[0], 1, '>=', 'delta', 'language') - ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '!=', 'delta', 'language'); + ->fieldLanguageCondition($this->fields[0], LANGUAGE_NONE, '<>', 'delta', 'language'); $this->assertEntityFieldQuery($query, array(), t('Test with a grouped delta + language meta condition (empty result set, both conditions unsatisifed).')); // Test grouping with another field to ensure that grouping cache is reset diff --git a/modules/system/system.module b/modules/system/system.module index 8fc0ffa..5b2cd2d 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2905,7 +2905,7 @@ function system_get_module_admin_tasks($module, $info) { ->condition('ml.hidden', 0, '>=') ->condition('ml.module', 'system') ->condition('m.number_parts', 1, '>') - ->condition('m.page_callback', 'system_admin_menu_block_page', '!='); + ->condition('m.page_callback', 'system_admin_menu_block_page', '<>'); foreach ($query->execute() as $link) { _menu_link_translate($link); if ($link['access']) {