Generated href url for nodes use "en" for all languages in sitemap.xml.

Example:

 <url>
  <loc>http://domain.com/en/products/endoscope-washers/espal-b</loc>
  <xhtml:link rel="alternate" hreflang="en" href="http://domain.com/en/products/endoscope-washers/espal-b"/>
  <xhtml:link rel="alternate" hreflang="ja" href="http://domain.com/en/products/endoscope-washers/espal-b"/>
  <priority>0</priority>
  <lastmod>2016-06-04T09:22:01+09:00</lastmod>
 </url>

Should be:

  <loc>http://domain.com/products/endoscope-washers/espal-b</loc>
  <xhtml:link rel="alternate" hreflang="en" href="http://domain.com/en/products/endoscope-washers/espal-b"/>
  <xhtml:link rel="alternate" hreflang="ja" href="http://domain.com/products/endoscope-washers/espal-b"/>
  <priority>0</priority>
  <lastmod>2016-06-04T09:22:01+09:00</lastmod>
 </url>

Anyone else had this?

Using:
Drupal 8.1.3
Default Language: Japanese
Secondary Language: English

Comments

nickolas.wilson created an issue. See original summary.

nickolas.wilson’s picture

Issue summary: View changes

  • gbyte.co committed a3228b4 on 8.x-2.x
    Issue #2752337 by nickolas.wilson: Href urls point to wrong language...
gbyte’s picture

Title: Generated href url for nodes use "en" for all languages » Href urls point to wrong language
Version: 8.x-2.5 » 8.x-2.x-dev
Status: Active » Closed (fixed)

Thanks, regression should be fixed in dev. Please test and feel free to reopen this issue if necessary.

Anonymous’s picture

Status: Closed (fixed) » Needs work

I have still the problem with the wrong urls. The main difference and advantage of simple sitemap against sitemapxml is not working.

Theses are my generated urls in german and english.

 <url>
  <loc>https://www.auctionlister.de/en/system-requirements</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://www.auctionlister.de/en/system-requirements"/>
  <xhtml:link rel="alternate" hreflang="de" href="https://www.auctionlister.de/en/system-requirements"/>
  <priority>0.5</priority>
  <lastmod>2016-06-04T20:44:26+02:00</lastmod>
 </url>

In both cases is the english url used.

Anonymous’s picture

Version: 8.x-2.x-dev » 8.x-2.5
gbyte’s picture

Version: 8.x-2.5 » 8.x-2.x-dev
Status: Needs work » Needs review

The issue should be fixed in the dev version of the module. Have you tried it? Please do not change the module version number in this issue, I can't fix a published stable. Instead test the dev version and close this issue if everything is working.

Anonymous’s picture

I tried the latest dev but this break my site. I switched back to the 2.5 and thought the issue is fixed. That was the reason for reopeining the issue.

gbyte’s picture

Have you run /update.php right after updating the module to the dev version?

gbyte’s picture

Status: Needs review » Closed (fixed)

Running update.php will update the database schema and clear your caches which will prepare your site for the new module version. I fixed the bug in dev, hence closing this ticket again. Please reopen if the issue reappears in dev.

Anonymous’s picture

Works indeed in dev. Thx for your support.

paintingguy’s picture

When enabling this:
Enable file (file) support
Sitemap settings for this entity type can be set below and overridden on its entity pages.

I get this error:

An error has occurred. This may result in an incomplete XML sitemap.
Please continue to the error page

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=353&op=do_nojs&op=do
StatusText: Internal Server Error
ResponseText: {

(PS, sorry for posting this in the wrong area).

gbyte’s picture

I know, there is a todo in the code. It seems to be a core bug filed here: https://www.drupal.org/node/2402533
Feel free to open an issue here as a reference for others.