diff --git a/modules/xmlsitemap/src/Tests/XmlSitemapEntityFunctionalTest.php b/modules/xmlsitemap/src/Tests/XmlSitemapEntityFunctionalTest.php index 088c448..b8887a9 100644 --- a/modules/xmlsitemap/src/Tests/XmlSitemapEntityFunctionalTest.php +++ b/modules/xmlsitemap/src/Tests/XmlSitemapEntityFunctionalTest.php @@ -77,7 +77,7 @@ public function testEntityLinkBundleSettingsForm() { $this->regenerateSitemap(); $this->drupalGet('sitemap.xml'); $this->assertResponse(200); - $this->assertNoText($entity->url()); + $this->assertNoText($entity->toUrl()); $entity->delete(); $this->assertNoSitemapLink('entity_test_mul'); @@ -95,7 +95,7 @@ public function testEntityLinkBundleSettingsForm() { $this->regenerateSitemap(); $this->drupalGet('sitemap.xml'); $this->assertResponse(200); - $this->assertText($entity->url()); + $this->assertText($entity->toUrl()); $id = $entity->id(); $entity->delete(); diff --git a/modules/xmlsitemap/src/XmlSitemapLinkStorage.php b/modules/xmlsitemap/src/XmlSitemapLinkStorage.php index 57e9792..5ec1a8d 100644 --- a/modules/xmlsitemap/src/XmlSitemapLinkStorage.php +++ b/modules/xmlsitemap/src/XmlSitemapLinkStorage.php @@ -58,7 +58,7 @@ public function create(EntityInterface $entity) { } $settings = xmlsitemap_link_bundle_load($entity->getEntityTypeId(), $entity->bundle()); - $uri = $entity->url(); + $uri = $entity->toUrl(); $entity->xmlsitemap += array( 'type' => $entity->getEntityTypeId(), 'id' => (string) $entity->id(), @@ -76,7 +76,7 @@ public function create(EntityInterface $entity) { $entity->xmlsitemap['lastmod'] = $entity->getChangedTime(); } - $url = $entity->url(); + $url = $entity->toUrl(); // The following values must always be checked because they are volatile. $entity->xmlsitemap['loc'] = $uri; $entity->xmlsitemap['access'] = isset($url) && $entity->access('view', $this->anonymousUser); diff --git a/modules/xmlsitemap/xmlsitemap.module b/modules/xmlsitemap/xmlsitemap.module index 3ed3ac8..e3d4c94 100644 --- a/modules/xmlsitemap/xmlsitemap.module +++ b/modules/xmlsitemap/xmlsitemap.module @@ -29,6 +29,7 @@ use Drupal\xmlsitemap\XmlSitemapInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpFoundation\Response; +use Drupal\Core\Link; /** @@ -1941,7 +1942,7 @@ function xmlsitemap_add_form_entity_summary(&$form, $entity, array $entity_info) if (\Drupal::service('path.validator')->isValid("admin/config/search/xmlsitemap/settings/$entity/$bundle")) { $edit_link = xmlsitemap_get_operation_link("internal://admin/config/search/xmlsitemap/settings/$entity/$bundle", array('title' => $bundle_info['label'], 'modal' => TRUE)); $url = Url::fromUri($edit_link['href'], $edit_link); - $row[] = \Drupal::l($edit_link['title'], $url); + $row[] = Link::fromTextAndUrl($edit_link['title'], $url); } else { // Bundle labels are assumed to be un-escaped input. @@ -2264,11 +2265,11 @@ function _xmlsitemap_get_blurb($check_version = TRUE) { $blurb = FALSE; if (!$check_version || (($version = _xmlsitemap_get_version()) && preg_match('/dev|unstable|alpha|beta|HEAD/i', $version))) { $sponsors = array( - \Drupal::l('Symantec', Url::fromUri('http://www.symantec.com/')), - \Drupal::l('WebWise Solutions', Url::fromUri('http://www.webwiseone.com/')), - \Drupal::l('Volacci', Url::fromUri('http://www.volacci.com/')), - \Drupal::l('lanetro', Url::fromUri('http://www.lanetro.com/')), - \Drupal::l('Coupons Dealuxe', Url::fromUri('http://couponsdealuxe.com/')), + Link::fromTextAndUrl('Symantec', Url::fromUri('http://www.symantec.com/')), + Link::fromTextAndUrl('WebWise Solutions', Url::fromUri('http://www.webwiseone.com/')), + Link::fromTextAndUrl('Volacci', Url::fromUri('http://www.volacci.com/')), + Link::fromTextAndUrl('lanetro', Url::fromUri('http://www.lanetro.com/')), + Link::fromTextAndUrl('Coupons Dealuxe', Url::fromUri('http://couponsdealuxe.com/')), ); // Don't extract the following string for translation. $blurb = '

Thank you for helping test the XML sitemap module rewrite. Please consider helping offset developer free time by donating or if your company is interested in sponsoring the rewrite or a specific feature, please contact the developer. Thank you to the following current sponsors: ' . implode(', ', $sponsors) . ', and all the individuals that have donated. This message will not be seen in the stable versions.

'; diff --git a/modules/xmlsitemap/xmlsitemap_custom/src/Controller/XmlSitemapCustomListController.php b/modules/xmlsitemap/xmlsitemap_custom/src/Controller/XmlSitemapCustomListController.php index 42c8cf0..599024b 100644 --- a/modules/xmlsitemap/xmlsitemap_custom/src/Controller/XmlSitemapCustomListController.php +++ b/modules/xmlsitemap/xmlsitemap_custom/src/Controller/XmlSitemapCustomListController.php @@ -4,6 +4,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\Link; use Drupal\Core\Url; /** @@ -43,7 +44,7 @@ public function render() { foreach ($result as $link) { $language = $this->languageManager()->getLanguage($link->language); $row = array(); - $row['loc'] = $this->l($link->loc, Url::fromUri('base://' . $link->loc)); + $row['loc'] = Link::fromTextAndUrl($link->loc, Url::fromUri('base://' . $link->loc)); $row['priority'] = number_format($link->priority, 1); $row['changefreq'] = $link->changefreq ? Unicode::ucfirst(xmlsitemap_get_changefreq($link->changefreq)) : t('None'); if (isset($header['language'])) {