Commit c0ce30b1 authored by gbyte.co's avatar gbyte.co Committed by gbyte.co

Issue #3047704 by rtdean93, gbyte.co: Empty rows in XML for Menu Placeholder items

parent 9c57e606
...@@ -153,10 +153,16 @@ class EntityMenuLinkContentUrlGenerator extends EntityUrlGeneratorBase { ...@@ -153,10 +153,16 @@ class EntityMenuLinkContentUrlGenerator extends EntityUrlGeneratorBase {
} }
} }
// There can be internal paths that are not rooted, like 'base:/path'.
if ($url_object->isRouted()) { if ($url_object->isRouted()) {
// Do not include paths that have no URL.
if($url_object->getRouteName() === '<nolink>') {
return FALSE;
}
$path = $url_object->getInternalPath(); $path = $url_object->getInternalPath();
} }
// There can be internal paths that are not rooted, like 'base:/path'.
else { // Handle base scheme. else { // Handle base scheme.
if (strpos($uri = $url_object->toUriString(), 'base:/') === 0 ) { if (strpos($uri = $url_object->toUriString(), 'base:/') === 0 ) {
$path = $uri[6] === '/' ? substr($uri, 7) : substr($uri, 6); $path = $uri[6] === '/' ? substr($uri, 7) : substr($uri, 6);
......
...@@ -718,6 +718,7 @@ class Simplesitemap { ...@@ -718,6 +718,7 @@ class Simplesitemap {
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* *
* @todo multiple variants * @todo multiple variants
* @todo: May want to use Simplesitemap::supplementDefaultSettings('entity', $settings) inside here instead of calling it everywhere this method is called.
*/ */
public function getEntityInstanceSettings($entity_type_id, $id) { public function getEntityInstanceSettings($entity_type_id, $id) {
if (empty($variants = $this->getVariants(FALSE))) { if (empty($variants = $this->getVariants(FALSE))) {
......
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