Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
At the moment generating sitemap of entities is not possible because of the module isn't able to add then at all to the sitemap.
Comment | File | Size | Author |
---|---|---|---|
#27 | interdiff.txt | 6.15 KB | amateescu |
#27 | 2479629-27.patch | 25.79 KB | amateescu |
#26 | interdiff.txt | 11.78 KB | amateescu |
#26 | 2479629-26.patch | 21.41 KB | amateescu |
#24 | generating_sitemap-2479629-24.patch | 18.03 KB | acrosman |
Comments
Comment #1
lauriiiComment #2
MichellePart of this patch was already committed in #2479261: Cache rebuild doesn't work after installing xmlsitemap_custom so it no longer applies cleanly. I'm attaching a new patch with that bit removed and no other changes.
I tested this patch by enabling tags in the sitemap and trying to save a node with tags. Before the patch, I got an error. After the patch, the node saved with no error. The tags aren't showing up in the sitemap but I don't know, yet, if that's to do with this issue or something else.
Comment #3
MichelleI was running into an error rebuilding the sitemap and now that has gone away and now I can see the tags are showing up.
I was going to mark this RTBC but then remembered I touched it last so someone else needs to do it. :)
Comment #4
lauriiiThere is still few code style changes that needs to be done before RTBC'ing this. Michelle would you like to tackle these?
Extra whitespace
Why is this commented out?
New line missing from the end of file
Comment #5
Lukas von BlarerTried to fix the issues:
xmlsitemap.services.yml
. There is nothing to be fixed, right?Comment #6
lauriiiThere is still missing newline in the end of the file :) Otherwise good work!
Comment #7
Lukas von BlarerOh, just edited my comment. You were too fast :)
There is a new line at the end of xmlsitemap.services.yml. There is nothing to be fixed, right?
Comment #8
lauriiiAhh sorry I misread the patch.. It was removed in the patch :)
Comment #9
MichelleSorry for missing this before, though I wouldn't have been able to answer the points from #4, anyway, since #2 and #3 were coming from lauriii's original patch and #1 I don't even see. LOL! So, sorry, no idea why you commented those lines out. :)
Comment #10
lauriiiHeh, I commented them out for a little easier debugging I think!
Comment #11
Lukas von BlarerThis is what I thought as well. Still RTBC.
Comment #12
Leksat CreditAttribution: Leksat at Amazee Labs commentedI've made some additional improvements to this patch.
(We wanted to use the xmlsitemap on one of our D8 projects, but then we realized that there is no translations support, and decided to stop work on this. So, posting here what we've achieved for now.)
Comment #13
gbyte CreditAttribution: gbyte commentedThese patches don't seem to work for me, as links are not being generated. I suspect the current maintainers will be able to patch this module more easily than me.
Anyway, needed a temporary solution to generating sitemaps in D8 so I wrote this simple module:
https://www.drupal.org/sandbox/gbyte.co/2561489
It generates sitemaps on the fly, so should be used on smaller sites. Also it seems to work well with multilingual sites, but needs more testing.Update: Now uses storage to save resources and rebuilds sitemap on cron run/config change. Works well on multilingual sites.
Comment #14
gbyte CreditAttribution: gbyte commentedFollow up: Simple XML Sitemap has been promoted to a full project.
Comment #15
andreyjan CreditAttribution: andreyjan commentedThe last patch from #12 comment is not applying to the current dev version, so I created a new patch.
Also fixed saving entity bundle settings which was not performing in xmlsitemap_link_bundle_settings_save callback.
Comment #16
pguillard CreditAttribution: pguillard commentedI can't tell it is RTBC but I confirm it fixes saving settings.
Comment #17
Dave ReidWe should be setting this state inside xmlsitemap_link_bundle_settings_save()? Where the heck did the _xmlsitemap_check_changed_links() function go?
Comment #18
Dave ReidWait, I see that setting the regeneration state *should* be set by \Drupal::service('xmlsitemap.link_storage')->updateMultiple() calling the checkChangedLinks() method.
Comment #19
Dave ReidI will need a re-roll on this as I've committed some of the separate issues. @gbyte.co I would love if we could coordinate on fixing up this module to work on current D8.
Comment #20
gbyte CreditAttribution: gbyte commented@Dave Reid This was my original intention, however the amount of legacy code in the D8 branch discouraged me. I got lost in endless files with procedural code and little structure, this was OK for D6/D7 but I think the D8 version would profit from a rewrite immensely. This is why I wrote simple xml sitemap, which has matured a lot in the last few weeks featuring most of the same functionality even exceeding in certain areas.
In any case I do think fixing up this module is important - there are cases, where I would install this module over simple xml sitemap,
for example on very large sites (millions of nodes) which would profit e.g. from the batch processing(update: batch processing has been implemented into Simple XML sitemap).BTW could you kindly mention simple xml sitemap as a D8 alternative on the description page? Regards.
Comment #22
pguillard CreditAttribution: pguillard commentedI just rerolled #15 here
Comment #23
acrosmanUsing the patch from #22 I get a syntax error in xmlsitemap/src/XmlSiteMapGenerator.php at 139 from an unbalanced set of parenthesis on the previous line (missing a close), and $message is not defined. While the module now saves the setting from the Sitemap Entities tab (which it wasn't without it) it still does not generate the map if I hit save on the rebuild tab. Because the $message is undefined I get a blank response from the batch:
Comment #24
acrosmanI've updated the patch from 22 to fix the syntax error I mentioned above and also to change the name of the logger in services.yml to match the expected name. I can now get the module to generate a basic sitemap with both the rebuild tab and on cron.
Comment #25
acrosmanComment #26
amateescu CreditAttribution: amateescu for Chapter Three commentedRerolled the patch to not include other fixes that already have their own issues and cleaned up some other things.
Comment #27
amateescu CreditAttribution: amateescu for Chapter Three commentedAnd with this interdiff, things are actually starting to work! :)
Comment #29
juampynr CreditAttribution: juampynr at Lullabot commentedMerged @amateescu's branch on top of 8.x-1.x. Thanks!
Comment #41
amateescu CreditAttribution: amateescu for Chapter Three commented