Closed (duplicate)
Project:
XML sitemap
Version:
7.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Dec 2011 at 10:07 UTC
Updated:
2 Aug 2015 at 19:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dave reidSitemaps do not always have a language context defined.
Comment #3
amitaibu>Sitemaps do not always have a language context defined.
Indeed. re-rolled patch.
Comment #4
kristen polI applied the patch to 7.x-2.0-rc1 and it works great. I have sitemaps in 3 languages and all the URLs look good.
Thanks!
Kristen
Comment #5
kevinwo commentedAfter applying the patch, I still encounter the same problem. Default language: zh-hant; Second language: en. Both my sitemap.xml and en/sitemap.xml display the same en links.
Comment #6
vasikei can confirm both the issue and the solution (patch #3).
Comment #7
marcoka commentedquestion about that patch
ORIGINAL
PATCHED:
if (!empty($sitemap->context['language'])) ... there is no $sitemap variable available in this context, so its undefined here.
i think you wanted to use $this?
DEBUG: http://www.root.artwaves.de/screensnapr/1337105612-NAddqS.jpg
by the way, it does not work here. added a sitemap in de and en translated the body of a node using entity translation to german and en, sitemap for de does not show up the node/alias, sitemap in en does.
SITEMAP EN
SITEMAP DE
Comment #8
noizo commented#3: 1370394-xmlsitemap-set-language-3.patch queued for re-testing.
Comment #9
noizo commentedSORRY, WRONG PLACE!
DELETE
Comment #10
unkn0wn commentedI tried to patch 7-2.x-dev and -rc1 with #3 with no success: i have multiple languages as subdomains, english (www.) is ok (content+taxonomy), but in german (de.) sitemap.xml i see only taxonomy urls and no one content url. Content translated via Entity Translation, i also use Domain Access + Domain XML Sitemap, maybe here is problem?
Comment #11
marcoka commentedas you use entity translation you may have a problem. AFAIK, entity translation uses one node and only translates fields, so i think atm there is no support for that. i18n adds a new node for every language.
Comment #12
unkn0wn commentedHere is really no support for entity translation: i revert to content translation, and everything is ok.
Comment #13
Anonymous (not verified) commentedThe url() API requires $options['language'] to be an object. The language_list() API returns an associative array of language parameters in array data and not a language object. The language_default() API returns an object for the default if no argument is given or returns the value of the object parameter if an argument is given. The argument should be a value matching a language object parameter.
Comment #14
Anonymous (not verified) commentedComment #15
Anonymous (not verified) commentedActually, I'm wrong, I'm reviewing this further.
Comment #16
kspal commentedFacing this same bug to reference nodes via the "XML sitemap node" module (I use Entity Translation), I found a temporary hack: the module "XML Sitemap Menu" is not suffering from this bug and will add your translated nodes referenced by menus into the right xml sitemaps.
This hack works of course if most of your content nodes are also accessible via menus (and you may get doublons in the xml sitemaps as well, some referenced by "XML Sitemap menu" and some by "Xml Sitemap node").
Just my 2 cents, if it can help...
Comment #17
mgiffordtagging for i18n.
Patch from #3 still applies nicely to the git repo.
Comment #18
hefterbrumi commentedAre there any news on entity translation and xml sitemap working together? I think its quite an important problem.
Comment #19
muschpusch commentedSince #7 is right i rerolled the patch using the $this... The bad news: it's still not working..
@earnie: since i don't know the xmlsitemap module very well do you have any idea where we should start debugging?
Comment #20
muschpusch commentedOk one step further :) hook_node_update does return the wrong language code: the original node language and not the "actual" node language. This works now well as long as you don't rebuild your sitemap. In the batch generation there seems to be something wrong...
Comment #21
mbauer commentedThe patch above did move the english nodes into the sitemap but seemed to ignore some languageneutral nodes, so at the end there are missing a lot of links in the sitemap if you have a site where translated and langugaeneutral nodes exist.
I found a module that solved the problem for me!
node_translation_sitemap
regards
Comment #22
muschpusch commentedok that module just works great :) Closing this issue
Comment #23
marcoka commentedi would not close this because actually xmlsitemap should include this. Maybe the module could be merged to submodule. Opinions?
Comment #24
batigol commented+ for a merge
Comment #25
kristiaanvandeneyndeAny update on whether the module in #21 works and might be integrated?
Comment #26
guedressel commentednode_translation_sitemap solves the problem for me.
Comment #27
mgiffordBit annoying that you need to add on https://drupal.org/project/node_translation_sitemap and that this isn't just done in xmlsitemap.
#20 is a pretty short patch. Would be much nicer to just get this fixed.
Comment #28
finex commentedThe patch #20 doesn't care about translation published status, or am I wrong?
Comment #29
michphip commentedfor me neither patch #20 nor the module node_translation_sitemap makes a differences. Both taxonomy terms and product displays wich are translated via entity translations are not appearing in other langauges (except english, the original)
Comment #30
pwiniacki commented@michphip, same here.
Comment #31
colanAlthough this issue is older, there's more work done in #1481798: Add support for Entity Translation & Title modules. Please correct me if I'm missing something, if this isn't actually a duplicate.
Comment #32
colanSorry, it's actually different. Here's a re-roll for the latest dev. Doesn't work for me, but it's a place to start.
Comment #33
colanAfter more research, it looks like this is in fact solved by the other ticket. Sorry about the confusion. Steps: