summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-07-20 21:15:54 (GMT)
committerAlex Pott2013-07-20 21:15:54 (GMT)
commit79347b882ae08a0d18a1d6f0205a83ed913a36a7 (patch)
tree0dafeed23a4d2e4639da32de2f612b26a78c73d1
parentb3149b25b747488e4e9e9971dc2a578ace367e70 (diff)
Issue #2017769 by pplantinga, clemens.tolboom, elachlan, katbailey, longwave: Fixed Links from update_helpful_links() should point to site root and not to update.php.
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php6
-rw-r--r--core/update.php6
2 files changed, 12 insertions, 0 deletions
diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
index 3f625b1..2761d62 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
@@ -146,6 +146,7 @@ class UpdateScriptTest extends WebTestBase {
$this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
$this->assertText(t('No pending updates.'));
$this->assertNoLink('Administration pages');
+ $this->assertNoLinkByHref('update.php', 0);
$this->clickLink('Front page');
$this->assertResponse(200);
@@ -154,6 +155,8 @@ class UpdateScriptTest extends WebTestBase {
$this->drupalLogin($admin_user);
$this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
$this->assertText(t('No pending updates.'));
+ $this->assertLink('Administration pages');
+ $this->assertNoLinkByHref('update.php', 1);
$this->clickLink('Administration pages');
$this->assertResponse(200);
}
@@ -170,6 +173,7 @@ class UpdateScriptTest extends WebTestBase {
$this->assertText('Updates were attempted.');
$this->assertLink('site');
$this->assertNoLink('Administration pages');
+ $this->assertNoLinkByHref('update.php', 0);
$this->assertNoLink('logged');
$this->clickLink('Front page');
$this->assertResponse(200);
@@ -183,6 +187,8 @@ class UpdateScriptTest extends WebTestBase {
$this->drupalPost(NULL, array(), t('Apply pending updates'));
$this->assertText('Updates were attempted.');
$this->assertLink('logged');
+ $this->assertLink('Administration pages');
+ $this->assertNoLinkByHref('update.php', 1);
$this->clickLink('Administration pages');
$this->assertResponse(200);
}
diff --git a/core/update.php b/core/update.php
index 607a1b7..8608f97 100644
--- a/core/update.php
+++ b/core/update.php
@@ -456,6 +456,12 @@ $request = Request::createFromGlobals();
drupal_container()
->set('request', $request);
+// Ensure that URLs generated for the home and admin pages don't have 'update.php'
+// in them.
+$generator = Drupal::urlGenerator();
+$generator->setBasePath(str_replace('/core', '', $request->getBasePath()) . '/');
+$generator->setScriptPath('');
+
// There can be conflicting 'op' parameters because both update and batch use
// this parameter name. We need the 'op' coming from a POST request to trump
// that coming from a GET request.