I have noticed that only Nodes set to "English" appear with an alias, while all nodes setted to "Hebrew" appear only with a permalink...

I should note that all nodes whatsoever, whether in Hebrew or English, have an English alias.

CommentFileSizeAuthor
#3 x.JPG1.46 MBBenia
sxml2.JPG70.5 KBBenia
sxml1.JPG54.8 KBBenia
SM.JPG34.71 KBBenia
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Benia created an issue. See original summary.

gbyte’s picture

Priority: Major » Normal
Status: Active » Closed (fixed)

Hi, according to your screenshot your sitemap was generated successfully. In order to add more content you will have to go to entity bundle pages (for the node type, it would be 'page' or 'article'). There you can add all entities of that bundle. Please see the readme file in the module directory.
Feel free to reopen the issue if you need more support.

Benia’s picture

FileSize
1.46 MB

Hi. Thanks for the data. I ran cron and there was formed a sitemap seemingly including all the pages in the site.

Just one last question - It seems only a small portion of the node addresses includes aliases... Most node addresses include only the permalink (i.e node/123). Shouldn't it always be that way? The advantage I could see for including the permalink is that it's more stable and generally doesn't require redirects.

gbyte’s picture

Aliases would be the usual way to go; to do that you will have to set an alias manually while creating each node or install the pathauto module which will do it for you.

Benia’s picture

But all nodes in the site already has aliases which I set manually each time I create a node.

There are no nodes without aliases in the site.

Given that situation, I try to understand why permalinks appear in about 92% of the Sitemap links...

Benia’s picture

.

Benia’s picture

Title: Sitemap doesn't generated ? » Sitemap not generated ?
Benia’s picture

Status: Closed (fixed) » Active

Clarification would be most appreciated about the permalink issue.

gbyte’s picture

Title: Sitemap not generated ? » Most URLs generated without aliases
Version: 8.x-2.5 » 8.x-2.x-dev
Component: Miscellaneous » Code
Category: Support request » Bug report

Frankly I have yet to face this issue. Maybe this has something to do with translation? Will have to do some investigation in the near future.

Benia’s picture

Your suggestion is interesting. I have now noticed that only Nodes setted to "English" appear with an alias, while all nodes setted to "Hebrew" appear only with a permalink...

I should note that all nodes whatsoever, whether in Hebrew or English, has an English-alias.

Given that piquant information, do you have any idea why indeed Hebrew-categorized nodes are represented in the sitemap only with a permalink?

Ben,

gbyte’s picture

I haven't investigated due to lack of time, but at first sight it seems setting the language on the URL object like so:

$url_object->setOption('language', $language);

and then getting the URL string like so

$url = $url_object->toString();

returns an unaliased path. The above code is located here, I am happy to review patches.

Benia’s picture

I am a humble PHP learner; I can read much of the PHP file quite comfortably and a bit change it per instructions but not really inventing or extending the modularity.

The moment you would tell me what to check in my side I will gladly do so; I suggest writing stepped instructions if more learners like me tries to check and report from their side...

Benia’s picture

BTW, given the fact I just learn basic PHP, I want to ask you if its even problematic that Google get only the permalinks?

Do you think it is dangerous or problematic for non-English website owners to send Google an XML sitemap only (or mostly) with permalinks?

  • If Google indexes the addresses as with permalink - It is problematic.
  • If Google receives the map and then take the alias and present it in the SERP (as happens when it scans a page, or a when a page is manually indexed or sent to it) than its not problematic.

AFAIK, Google and any other major SE like Bing, always crawls a page and get its alias; I am sure 99% that it will happen this time and the SERP will display aliases, but I can't say for sure given the fact I never sent an XML sitemap that includes permalinks (in Drupa 7 it was always aliases).

Would thank you dearly for your take on this.

gbyte’s picture

Google swallowing permlinks instead of the aliases is not problematic at all, in some cases it might even be beneficial. The question remains however why the URL class returns permlinks for localized paths instead of aliases...

Benia’s picture

Indeed, and BTW what you say is very interesting to me. If you have spare 4 minutes, can you please tell me as a sidenote why it might be beneficial? I believe I will learn from it! Thanks !!!

gbyte’s picture

Sure, it's because the permlink doesn't change and the alias can be changed manually or automatically (through pathauto module etc) and the old indexed alias would lead to a dead page until next sitemap generation.

Benia’s picture

Oh yes, indeed. From Drupal 7 I am used to use (global)Redirect but indeed sending permalinks can save even that.

Great then, I'll use it as it is...

BTW, I humbly suggest adding an option (might be even the default) to send permalinks / Aliases. Or else, sending only permalinks in any case...

Benia’s picture

Interesting discussion regarding the permalink/aliases issue in Stackexchange ProWebmasters:

http://webmasters.stackexchange.com/questions/98321/can-an-xml-sitemap-h...

gbyte’s picture

Status: Active » Closed (won't fix)

Thanks, I've looked at the stackexchange answers but am unable to find anything which would benefit this discussion.

I am not sure why core sometimes puts out permalinks instead of aliases, but maintain that this is an esthetic issue at most and is irrelevant to functionality, especially because the sitemap is meant to be viewed by bots only.
Hence closing as "won't fix".

Benia’s picture

With time, I've come to prefer a sitemap that puts only permalinks: Aliases can change, and not always we have redirects, hence, permalinks is best.

Would you make the module to create a only-permalink links?

This could solve any future language-problem.

Benia’s picture

Status: Closed (won't fix) » Active

Please see my comment above.

gbyte’s picture

Status: Active » Closed (won't fix)

In case an alias changes (which is rare), so does the link in the sitemap after next generation - no harm done. I would prefer to invest my time in other more pressing issues, but will gladly review patches if anyone would be willing to implement this as an optional feature triggered by a setting.

Benia’s picture

I can guarantee it isn't that rare in many sites as I work much with content in different sites of different types and business contexts.

Moreover, when there isn't an efficient redirect mechanism, or even knowledge of the process of creating 301's in .htaccess, harm can indeed be made.

As you already got my recommendation to make the module send permalinks and not aliases, I think my job here is done. I am not a PHP-SQL programmer but if I were, I would patch this without any doubt.

gbyte’s picture

The module generates permlinks instead of aliases for non-default languages because of a core bug, see #2689459: If you don't want to translate your URL alias, the original URL alias won't work with your translations.
This has to be fixed in core. The workaround is to make aliases tranlatable and translate them.

gbyte’s picture

Issue summary: View changes
BarisW’s picture

Status: Closed (duplicate) » Active

Just found out the following:

- My nodes are Dutch
- If they have a Dutch alias, the permalink is used in the sitemap.xml
- If I change the alias to language undefined, the alias is used in the sitemap.xml

This seems like a bug in the module, right?

gbyte’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Active » Closed (works as designed)

@BarisW Did you take a look at the linked Drupal core issue and the workaround above?