diff options
author | Dries | 2013-06-29 21:39:05 (GMT) |
---|---|---|
committer | Dries | 2013-06-29 21:39:05 (GMT) |
commit | 0a91fd93a72e2fc5c3ffa54a06e67eb26cafb10c (patch) | |
tree | f8a61466bd5ca2ca6cda56b06035c99263e37dd9 | |
parent | 0cbc8d342a09dcf01fcef41670ff79a9a1712c36 (diff) |
Issue #2020405 by Pancho: Correct misspelling of 'referenceable'.
10 files changed, 54 insertions, 54 deletions
diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 66de2c3..5e438e6 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -115,7 +115,7 @@ function entity_reference_field_validate(EntityInterface $entity = NULL, $field, } if ($ids) { - $valid_ids = entity_reference_get_selection_handler($instance, $entity)->validateReferencableEntities(array_keys($ids)); + $valid_ids = entity_reference_get_selection_handler($instance, $entity)->validateReferenceableEntities(array_keys($ids)); $invalid_entities = array_diff_key($ids, array_flip($valid_ids)); if ($invalid_entities) { @@ -353,7 +353,7 @@ function entity_reference_settings_ajax_submit($form, &$form_state) { * Implements hook_options_list(). */ function entity_reference_options_list(FieldDefinitionInterface $field_definition, EntityInterface $entity) { - if (!$options = entity_reference_get_selection_handler($field_definition, $entity)->getReferencableEntities()) { + if (!$options = entity_reference_get_selection_handler($field_definition, $entity)->getReferenceableEntities()) { return array(); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php index 6a42b57..f1e9178 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/EntityReferenceAutocomplete.php @@ -77,7 +77,7 @@ class EntityReferenceAutocomplete { // Get an array of matching entities. $widget = entity_get_form_display($instance['entity_type'], $instance['bundle'], 'default')->getComponent($instance['field_name']); $match_operator = !empty($widget['settings']['match_operator']) ? $widget['settings']['match_operator'] : 'CONTAINS'; - $entity_labels = $handler->getReferencableEntities($string, $match_operator, 10); + $entity_labels = $handler->getReferenceableEntities($string, $match_operator, 10); // Loop through the entities and convert them into autocomplete output. foreach ($entity_labels as $values) { diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php index d8a73b9..0956657 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionBroken.php @@ -25,23 +25,23 @@ class SelectionBroken implements SelectionInterface { } /** - * Implements SelectionInterface::getReferencableEntities(). + * Implements SelectionInterface::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { return array(); } /** - * Implements SelectionInterface::countReferencableEntities(). + * Implements SelectionInterface::countReferenceableEntities(). */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') { + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') { return 0; } /** - * Implements SelectionInterface::validateReferencableEntities(). + * Implements SelectionInterface::validateReferenceableEntities(). */ - public function validateReferencableEntities(array $ids) { + public function validateReferenceableEntities(array $ids) { return array(); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php index 069a2cb..4379454 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Type/Selection/SelectionInterface.php @@ -20,21 +20,21 @@ use Drupal\Core\Database\Query\SelectInterface; interface SelectionInterface { /** - * Returns a list of referencable entities. + * Returns a list of referenceable entities. * * @return array - * An array of referencable entities. Keys are entity IDs and + * An array of referenceable entities. Keys are entity IDs and * values are (safe HTML) labels to be displayed to the user. */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0); + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0); /** - * Counts entities that are referencable by a given field. + * Counts entities that are referenceable by a given field. * * @return int - * The number of referencable entities. + * The number of referenceable entities. */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS'); + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS'); /** * Validates that entities can be referenced by this field. @@ -42,7 +42,7 @@ interface SelectionInterface { * @return array * An array of valid entity IDs. */ - public function validateReferencableEntities(array $ids); + public function validateReferenceableEntities(array $ids); /** * Validates input from an autocomplete widget that has no ID. diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php index c794230..94faf22 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php @@ -155,9 +155,9 @@ class SelectionBase implements SelectionInterface { } /** - * Implements SelectionInterface::getReferencableEntities(). + * Implements SelectionInterface::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { $target_type = $this->fieldDefinition->getFieldSetting('target_type'); $query = $this->buildEntityQuery($match, $match_operator); @@ -182,9 +182,9 @@ class SelectionBase implements SelectionInterface { } /** - * Implements SelectionInterface::countReferencableEntities(). + * Implements SelectionInterface::countReferenceableEntities(). */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') { + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') { $query = $this->buildEntityQuery($match, $match_operator); return $query ->count() @@ -192,9 +192,9 @@ class SelectionBase implements SelectionInterface { } /** - * Implements SelectionInterface::validateReferencableEntities(). + * Implements SelectionInterface::validateReferenceableEntities(). */ - public function validateReferencableEntities(array $ids) { + public function validateReferenceableEntities(array $ids) { $result = array(); if ($ids) { $target_type = $this->fieldDefinition->getFieldSetting('target_type'); @@ -212,7 +212,7 @@ class SelectionBase implements SelectionInterface { * Implements SelectionInterface::validateAutocompleteInput(). */ public function validateAutocompleteInput($input, &$element, &$form_state, $form, $strict = TRUE) { - $entities = $this->getReferencableEntities($input, '=', 6); + $entities = $this->getReferenceableEntities($input, '=', 6); $params = array( '%value' => $input, '@value' => $input, @@ -244,7 +244,7 @@ class SelectionBase implements SelectionInterface { } /** - * Builds an EntityQuery to get referencable entities. + * Builds an EntityQuery to get referenceable entities. * * @param string|null $match * (Optional) Text to match the label against. Defaults to NULL. diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php index 8106bb9..9a611d4 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php @@ -33,15 +33,15 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); } - protected function assertReferencable(FieldDefinitionInterface $field_definition, $tests, $handler_name) { + protected function assertReferenceable(FieldDefinitionInterface $field_definition, $tests, $handler_name) { $handler = entity_reference_get_selection_handler($field_definition); foreach ($tests as $test) { foreach ($test['arguments'] as $arguments) { - $result = call_user_func_array(array($handler, 'getReferencableEntities'), $arguments); + $result = call_user_func_array(array($handler, 'getReferenceableEntities'), $arguments); $this->assertEqual($result, $test['result'], format_string('Valid result set returned by @handler.', array('@handler' => $handler_name))); - $result = call_user_func_array(array($handler, 'countReferencableEntities'), $arguments); + $result = call_user_func_array(array($handler, 'countReferenceableEntities'), $arguments); if (!empty($test['result'])) { $bundle = key($test['result']); $count = count($test['result'][$bundle]); @@ -119,7 +119,7 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { // Test as a non-admin. $normal_user = $this->drupalCreateUser(array('access content')); $GLOBALS['user'] = $normal_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -166,12 +166,12 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { 'result' => array(), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Node handler'); + $this->assertReferenceable($instance, $referenceable_tests, 'Node handler'); // Test as an admin. $admin_user = $this->drupalCreateUser(array('access content', 'bypass node access')); $GLOBALS['user'] = $admin_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -195,7 +195,7 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Node handler (admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'Node handler (admin)'); } /** @@ -265,7 +265,7 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { // Test as a non-admin. $GLOBALS['user'] = $users['non_admin']; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -301,10 +301,10 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { 'result' => array(), ), ); - $this->assertReferencable($instance, $referencable_tests, 'User handler'); + $this->assertReferenceable($instance, $referenceable_tests, 'User handler'); $GLOBALS['user'] = $users['admin']; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -340,7 +340,7 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'User handler (admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'User handler (admin)'); } /** @@ -436,7 +436,7 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { // Test as a non-admin. $normal_user = $this->drupalCreateUser(array('access content', 'access comments')); $GLOBALS['user'] = $normal_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -470,12 +470,12 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { 'result' => array(), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Comment handler'); + $this->assertReferenceable($instance, $referenceable_tests, 'Comment handler'); // Test as a comment admin. $admin_user = $this->drupalCreateUser(array('access content', 'access comments', 'administer comments')); $GLOBALS['user'] = $admin_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -488,12 +488,12 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Comment handler (comment admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'Comment handler (comment admin)'); // Test as a node and comment admin. $admin_user = $this->drupalCreateUser(array('access content', 'access comments', 'administer comments', 'bypass node access')); $GLOBALS['user'] = $admin_user; - $referencable_tests = array( + $referenceable_tests = array( array( 'arguments' => array( array(NULL, 'CONTAINS'), @@ -507,6 +507,6 @@ class EntityReferenceSelectionAccessTest extends WebTestBase { ), ), ); - $this->assertReferencable($instance, $referencable_tests, 'Comment handler (comment + node admin)'); + $this->assertReferenceable($instance, $referenceable_tests, 'Comment handler (comment + node admin)'); } } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php index 09dd2c8..f7b8fbc 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionSortTest.php @@ -125,7 +125,7 @@ class EntityReferenceSelectionSortTest extends WebTestBase { // Not only assert the result, but make sure the keys are sorted as // expected. - $result = $handler->getReferencableEntities(); + $result = $handler->getReferenceableEntities(); $expected_result = array( $nodes['published2']->nid => $node_labels['published2'], $nodes['published1']->nid => $node_labels['published1'], @@ -138,7 +138,7 @@ class EntityReferenceSelectionSortTest extends WebTestBase { 'direction' => 'ASC', ); $handler = entity_reference_get_selection_handler($instance); - $result = $handler->getReferencableEntities(); + $result = $handler->getReferenceableEntities(); $expected_result = array( $nodes['published1']->nid => $node_labels['published1'], $nodes['published2']->nid => $node_labels['published2'], diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php index 0bfdae3..8127682 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/Views/SelectionTest.php @@ -71,7 +71,7 @@ class SelectionTest extends WebTestBase { // Get values from selection handler. $handler = entity_reference_get_selection_handler($instance); - $result = $handler->getReferencableEntities(); + $result = $handler->getReferenceableEntities(); $success = FALSE; foreach ($result as $node_type => $values) { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php index e49f31e..35b04a0 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/entity_reference/selection/TermSelection.php @@ -51,11 +51,11 @@ class TermSelection extends SelectionBase { /** - * Overrides SelectionBase::getReferencableEntities(). + * Overrides SelectionBase::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { if ($match || $limit) { - return parent::getReferencableEntities($match , $match_operator, $limit); + return parent::getReferenceableEntities($match , $match_operator, $limit); } $options = array(); diff --git a/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php b/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php index 575c000..c5df6d7 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php +++ b/core/modules/views/lib/Drupal/views/Plugin/entity_reference/selection/ViewsSelection.php @@ -155,9 +155,9 @@ class ViewsSelection implements SelectionInterface { } /** - * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::getReferencableEntities(). + * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::getReferenceableEntities(). */ - public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { + public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { $handler_settings = $this->fieldDefinition->getFieldSetting('handler_settings'); $display_name = $handler_settings['view']['display_name']; $arguments = $handler_settings['view']['arguments']; @@ -178,17 +178,17 @@ class ViewsSelection implements SelectionInterface { } /** - * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::countReferencableEntities(). + * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::countReferenceableEntities(). */ - public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') { - $this->getReferencableEntities($match, $match_operator); + public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') { + $this->getReferenceableEntities($match, $match_operator); return $this->view->pager->getTotalItems(); } /** - * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::validateReferencableEntities(). + * Implements \Drupal\entity_reference\Plugin\Type\Selection\SelectionInterface::validateReferenceableEntities(). */ - public function validateReferencableEntities(array $ids) { + public function validateReferenceableEntities(array $ids) { $handler_settings = $this->fieldDefinition->getFieldSetting('handler_settings'); $display_name = $handler_settings['view']['display_name']; $arguments = $handler_settings['view']['arguments']; |