Skip to content

Instantly share code, notes, and snippets.

@colepacak
Created February 6, 2018 22:12
Show Gist options
  • Select an option

  • Save colepacak/64082e54d54c10ee0a93c19ce721d02a to your computer and use it in GitHub Desktop.

Select an option

Save colepacak/64082e54d54c10ee0a93c19ce721d02a to your computer and use it in GitHub Desktop.

Revisions

  1. colepacak created this gist Feb 6, 2018.
    13 changes: 13 additions & 0 deletions clear-node-static-cache-after-chunk.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    diff --git a/src/XmlSitemapWriter.php b/src/XmlSitemapWriter.php
    index 6497da2..8f22722 100644
    --- a/src/XmlSitemapWriter.php
    +++ b/src/XmlSitemapWriter.php
    @@ -157,6 +157,8 @@ class XmlSitemapWriter extends \XMLWriter {
    */
    public function generateXML() {
    // @codingStandardsIgnoreEnd
    + // Clear out the node static cache once the chunk has finished.
    + \Drupal::entityTypeManager()->getStorage('node')->resetCache();
    return \Drupal::service('xmlsitemap_generator')->generateChunk($this->sitemap, $this, $this->sitemap_page);
    }