diff --git a/core/modules/config/config.module b/core/modules/config/config.module index b284998..557b07b 100644 --- a/core/modules/config/config.module +++ b/core/modules/config/config.module @@ -1,5 +1,12 @@ $type_info) { - if (isset($type_info['list controller class'])) { + if (!empty($type_info['list controller class'])) { $controller = config_get_list_controller($entity_type); $items += $controller->hookMenu(); } @@ -59,7 +66,7 @@ function config_entity_listing_page($controller) { * Either returns the listing page as JSON, or calls drupal_goto() to * redirect back to the listing page. */ -function config_ajax_callback(EntityListControllerInterface $controller, EntityInterface $entity, $op) { +function config_ajax_listing_callback(EntityListControllerInterface $controller, EntityInterface $entity, $op) { // Perform the operation. $entity->$op(); @@ -71,4 +78,5 @@ function config_ajax_callback(EntityListControllerInterface $controller, EntityI else { drupal_goto($controller->getPath()); } + } diff --git a/core/modules/config/lib/Drupal/config/EntityListControllerBase.php b/core/modules/config/lib/Drupal/config/EntityListControllerBase.php index 963de3c..9f4aed8 100644 --- a/core/modules/config/lib/Drupal/config/EntityListControllerBase.php +++ b/core/modules/config/lib/Drupal/config/EntityListControllerBase.php @@ -62,6 +62,9 @@ abstract class EntityListControllerBase implements EntityListControllerInterface return $this->storage; } + /** + * Implements Drupal\config\EntityListControllerInterface::getPath(); + */ public function getPath() { return $this->entityInfo['list path']; } @@ -161,7 +164,7 @@ abstract class EntityListControllerBase implements EntityListControllerInterface } /** - * Implements Drupal\config\EntityListControllerInterface::renderList(); + * Implements Drupal\config\EntityListControllerInterface::renderListAJAX(); */ public function renderListAJAX() { $list = $this->renderList(); diff --git a/core/modules/config/lib/Drupal/config/EntityListControllerInterface.php b/core/modules/config/lib/Drupal/config/EntityListControllerInterface.php index cfc22b0..6df6bcb 100644 --- a/core/modules/config/lib/Drupal/config/EntityListControllerInterface.php +++ b/core/modules/config/lib/Drupal/config/EntityListControllerInterface.php @@ -22,17 +22,26 @@ interface EntityListControllerInterface { /** * Gets the ConfigEntityController. * - * @todo Put in correct namespace and docs here. + * @return Drupal\entity\EntityStorageController + * An entity storage controller instance for an entity type. */ public function getStorageController(); /** * Gets the hook_menu array item. * - * @todo Put in correct docs here. + * @return array */ public function hookMenu(); + /* + * Returns the path for the listing page. + * + * @return string + * The menu path for the listing. + */ + public function getPath(); + /** * Builds an array of data for each row. * @@ -71,6 +80,7 @@ interface EntityListControllerInterface { * Renders a list of action links. * * @return array + * An renderable array of action links. */ public function buildActionLinks(EntityInterface $entity); @@ -78,6 +88,7 @@ interface EntityListControllerInterface { * Provides an array of information to render action links. * * @return array + * An array of action link data to use in buildActionLinks. */ public function defineActionLinks(EntityInterface $entity); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListingTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListingTest.php index 683c8ab..cc01b66 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListingTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListingTest.php @@ -36,10 +36,10 @@ class ConfigEntityListingTest extends WebTestBase { function testListingPlugin() { $controller = config_get_list_controller('config_test'); - // Get a list of Config entities. + // Get a list of config entities. $list = $controller->getList(); - $this->assertEqual(count($list), 1, 'Correct number of plugins found.'); - $this->assertTrue(!empty($list['default']), '"Default" config entity key found in list.'); + $this->assertEqual(count($list), 1, 'Correct number of entities found.'); + $this->assertTrue(!empty($list['default']), '"Default" config entity key found in entity list.'); $this->assertTrue($list['default'] instanceof ConfigEntityBase, '"Default" config entity is an instance of ConfigEntityBase'); }