Commit 79347b88 authored by alexpott's avatar alexpott

Issue #2017769 by pplantinga, clemens.tolboom, elachlan, katbailey, longwave:...

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.
parent b3149b25
......@@ -146,6 +146,7 @@ function testNoUpdateFunctionality() {
$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 @@ function testNoUpdateFunctionality() {
$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 @@ function testSuccessfulUpdateFunctionality() {
$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 @@ function testSuccessfulUpdateFunctionality() {
$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);
}
......
......@@ -456,6 +456,12 @@ function update_check_requirements($skip_warnings = FALSE) {
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment