Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lauriii’s picture

Status: Active » Needs review
FileSize
14.68 KB
Michelle’s picture

FileSize
13.6 KB

Part 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.

Michelle’s picture

I 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. :)

lauriii’s picture

Status: Needs review » Needs work

There is still few code style changes that needs to be done before RTBC'ing this. Michelle would you like to tackle these?

  1. +++ b/src/XmlSitemapGenerator.php
    @@ -69,6 +70,13 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
    +  /** ¶
    

    Extra whitespace

  2. +++ b/xmlsitemap.module
    @@ -172,9 +172,9 @@ function _xmlsitemap_rebuild_form_access() {
    +  /*if (!\Drupal::state()->get('xmlsitemap_regenerate_needed')) {
         return;
    -  }
    +  }*/
    

    Why is this commented out?

  3. +++ b/xmlsitemap.services.yml
    @@ -1,11 +1,14 @@
    \ No newline at end of file
    

    New line missing from the end of file

Lukas von Blarer’s picture

Status: Needs work » Needs review
FileSize
13.21 KB

Tried to fix the issues:

  1. fixed.
  2. I added back the lines since I didn't understand why the were commented out. Should they be deleted?
  3. There is a new line at the end of xmlsitemap.services.yml. There is nothing to be fixed, right?
lauriii’s picture

Status: Needs review » Needs work
+++ b/xmlsitemap.services.yml
@@ -1,11 +1,14 @@
\ No newline at end of file

There is still missing newline in the end of the file :) Otherwise good work!

Lukas von Blarer’s picture

Status: Needs work » Needs review

Oh, 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?

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Ahh sorry I misread the patch.. It was removed in the patch :)

Michelle’s picture

Sorry 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. :)

lauriii’s picture

Heh, I commented them out for a little easier debugging I think!

Lukas von Blarer’s picture

This is what I thought as well. Still RTBC.

Leksat’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
16.6 KB
3.52 KB

I'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.)

gbyte’s picture

These 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.

gbyte’s picture

Follow up: Simple XML Sitemap has been promoted to a full project.

andreyjan’s picture

The 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.

pguillard’s picture

I can't tell it is RTBC but I confirm it fixes saving settings.

Dave Reid’s picture

+++ b/src/Form/XmlSitemapLinkBundleSettingsForm.php
@@ -129,6 +129,7 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase implements Contain
     xmlsitemap_link_bundle_settings_save($this->entity_type, $this->bundle_type, $xmlsitemap, TRUE);
+    \Drupal::state()->set('xmlsitemap_regenerate_needed', TRUE);

We should be setting this state inside xmlsitemap_link_bundle_settings_save()? Where the heck did the _xmlsitemap_check_changed_links() function go?

Dave Reid’s picture

Status: Needs review » Needs work

Wait, I see that setting the regeneration state *should* be set by \Drupal::service('xmlsitemap.link_storage')->updateMultiple() calling the checkChangedLinks() method.

Dave Reid’s picture

I 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.

gbyte’s picture

@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.

The last submitted patch, 15: generating_sitemap_of-2479629-15.patch, failed testing.

pguillard’s picture

I just rerolled #15 here

acrosman’s picture

Status: Needs review » Needs work

Using 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:

An error has occurred.
Please continue to the error page

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=34&op=do_nojs&op=do
StatusText: OK
ResponseText: 
acrosman’s picture

I'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.

acrosman’s picture

Status: Needs work » Needs review
amateescu’s picture

Rerolled the patch to not include other fixes that already have their own issues and cleaned up some other things.

amateescu’s picture

And with this interdiff, things are actually starting to work! :)

  • amateescu committed 599033c on 8.x-1.x
    Issue #2479629 by Leksat, amateescu, lauriii, Michelle, Lukas von Blarer...
  • amateescu committed 7be8556 on 8.x-1.x
    Issue #2479629 followup by amateescu: Generating sitemap of entities...
juampynr’s picture

Status: Needs review » Fixed

Merged @amateescu's branch on top of 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

The last submitted patch, 22: generating_sitemap_of-2479629-22.patch, failed testing.

The last submitted patch, 24: generating_sitemap-2479629-24.patch, failed testing.

The last submitted patch, 24: generating_sitemap-2479629-24.patch, failed testing.

The last submitted patch, 24: generating_sitemap-2479629-24.patch, failed testing.

The last submitted patch, 26: 2479629-26.patch, failed testing.

Status: Closed (fixed) » Needs work

The last submitted patch, 27: 2479629-27.patch, failed testing.

The last submitted patch, 22: generating_sitemap_of-2479629-22.patch, failed testing.

The last submitted patch, 24: generating_sitemap-2479629-24.patch, failed testing.

The last submitted patch, 26: 2479629-26.patch, failed testing.

The last submitted patch, 27: 2479629-27.patch, failed testing.

amateescu’s picture

Status: Needs work » Closed (fixed)