summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2012-11-27 05:55:40 (GMT)
committerwebchick2012-11-27 05:55:40 (GMT)
commit8019e5593c0284f03634bb2bdc4c86a9d86fb1c3 (patch)
tree08aa7954c5e8d359a5731522686f2154a74dfe23
parenta99bd7285c31a4cbfee700b74ca45a0cecbcf3b4 (diff)
Issue #1848072 by katbailey, sun: Fixed Path alias manager hardcodes keyvalue.database instead of using the generic factory.
-rw-r--r--core/includes/bootstrap.inc2
-rw-r--r--core/lib/Drupal/Core/CoreBundle.php2
-rw-r--r--core/lib/Drupal/Core/Path/AliasManager.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php14
4 files changed, 10 insertions, 12 deletions
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 43d1eac..c47db5e 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2487,7 +2487,7 @@ function drupal_container(Container $new_container = NULL, $rebuild = FALSE) {
$container->register('path.alias_manager', 'Drupal\Core\Path\AliasManager')
->addArgument(new Reference('database'))
- ->addArgument(new Reference('keyvalue.database'));
+ ->addArgument(new Reference('keyvalue'));
// Register the EntityManager.
$container->register('plugin.manager.entity', 'Drupal\Core\Entity\EntityManager');
diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php
index 8b4eaaa..c6381c8 100644
--- a/core/lib/Drupal/Core/CoreBundle.php
+++ b/core/lib/Drupal/Core/CoreBundle.php
@@ -77,7 +77,7 @@ class CoreBundle extends Bundle {
$container->register('path.alias_manager', 'Drupal\Core\Path\AliasManager')
->addArgument(new Reference('database'))
- ->addArgument(new Reference('keyvalue.database'));
+ ->addArgument(new Reference('keyvalue'));
// Register the EntityManager.
$container->register('plugin.manager.entity', 'Drupal\Core\Entity\EntityManager');
diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php
index 02433ce..47bf77b 100644
--- a/core/lib/Drupal/Core/Path/AliasManager.php
+++ b/core/lib/Drupal/Core/Path/AliasManager.php
@@ -8,7 +8,7 @@
namespace Drupal\Core\Path;
use Drupal\Core\Database\Connection;
-use Drupal\Core\KeyValueStore\KeyValueDatabaseFactory;
+use Drupal\Core\KeyValueStore\KeyValueFactory;
class AliasManager implements AliasManagerInterface {
@@ -78,7 +78,7 @@ class AliasManager implements AliasManagerInterface {
*/
protected $preloadedPathLookups = array();
- public function __construct(Connection $connection, KeyValueDatabaseFactory $keyvalue) {
+ public function __construct(Connection $connection, KeyValueFactory $keyvalue) {
$this->connection = $connection;
$this->state = $keyvalue->get('state');
$this->langcode = language(LANGUAGE_TYPE_URL)->langcode;
diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php
index bbca543..21a129a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php
@@ -7,16 +7,15 @@
namespace Drupal\system\Tests\Path;
-use Drupal\simpletest\UnitTestBase;
+use Drupal\simpletest\DrupalUnitTestBase;
use Drupal\Core\Database\Database;
-use Drupal\Core\KeyValueStore\KeyValueDatabaseFactory;
use Drupal\Core\Path\Path;
use Drupal\Core\Path\AliasManager;
/**
* Tests path alias CRUD and lookup functionality.
*/
-class AliasTest extends UnitTestBase {
+class AliasTest extends DrupalUnitTestBase {
public static function getInfo() {
return array(
@@ -26,9 +25,8 @@ class AliasTest extends UnitTestBase {
);
}
- function __construct($test_id = NULL) {
- parent::__construct($test_id);
-
+ public function setUp() {
+ parent::setUp();
$this->fixtures = new UrlAliasFixtures();
}
@@ -45,7 +43,7 @@ class AliasTest extends UnitTestBase {
$this->fixtures->createTables($connection);
//Create AliasManager and Path object.
- $aliasManager = new AliasManager($connection, new KeyValueDatabaseFactory($connection));
+ $aliasManager = new AliasManager($connection, $this->container->get('keyvalue'));
$path = new Path($connection, $aliasManager);
$aliases = $this->fixtures->sampleUrlAliases();
@@ -98,7 +96,7 @@ class AliasTest extends UnitTestBase {
$this->fixtures->createTables($connection);
//Create AliasManager and Path object.
- $aliasManager = new AliasManager($connection, new KeyValueDatabaseFactory($connection));
+ $aliasManager = new AliasManager($connection, $this->container->get('keyvalue'));
$pathObject = new Path($connection, $aliasManager);
// Test the situation where the source is the same for multiple aliases.