Guest User

Untitled

a guest
Jun 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. ## Current Line in googlesitemaps/code/GoogleSitemap.php
  2. $this->Pages = Versioned::get_by_stage('SiteTree', 'Live');
  3.  
  4. ## Should Probably be like this
  5.  
  6. $subsite = $this->CurrentSubsite();
  7. if ($subsite) {
  8. $this->Pages = Versioned::get_by_stage('SiteTree', 'Live','`SiteTree_Live`.SubsiteID = '.$subsite->ID);
  9. } else {
  10. $this->Pages = Versioned::get_by_stage('SiteTree', 'Live','`SiteTree_Live`.SubsiteID = 0');
  11. }
  12.  
  13.  
  14. ## For Loop Change approx around line 45
  15. foreach($this->Pages as $page) {
  16. // Only include pages from this host and pages which are not an instance of ErrorPage
  17. if(parse_url($page->AbsoluteLink(), PHP_URL_HOST) == $_SERVER['HTTP_HOST'] && !($page instanceof ErrorPage)) {
  18.  
  19. ## Change to
  20. foreach($this->Pages as $page) {
  21. // Only include pages from this host and pages which are not an instance of ErrorPage
  22. if(!($page instanceof ErrorPage)) {
Add Comment
Please, Sign In to add comment