Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Current Line in googlesitemaps/code/GoogleSitemap.php
- $this->Pages = Versioned::get_by_stage('SiteTree', 'Live');
- ## Should Probably be like this
- $subsite = $this->CurrentSubsite();
- if ($subsite) {
- $this->Pages = Versioned::get_by_stage('SiteTree', 'Live','`SiteTree_Live`.SubsiteID = '.$subsite->ID);
- } else {
- $this->Pages = Versioned::get_by_stage('SiteTree', 'Live','`SiteTree_Live`.SubsiteID = 0');
- }
- ## For Loop Change approx around line 45
- foreach($this->Pages as $page) {
- // Only include pages from this host and pages which are not an instance of ErrorPage
- if(parse_url($page->AbsoluteLink(), PHP_URL_HOST) == $_SERVER['HTTP_HOST'] && !($page instanceof ErrorPage)) {
- ## Change to
- foreach($this->Pages as $page) {
- // Only include pages from this host and pages which are not an instance of ErrorPage
- if(!($page instanceof ErrorPage)) {
Add Comment
Please, Sign In to add comment