diff --git a/code/GoogleSitemap.php b/code/GoogleSitemap.php index aaa6050..433aa96 100644 --- a/code/GoogleSitemap.php +++ b/code/GoogleSitemap.php @@ -202,6 +202,15 @@ class GoogleSitemap { return $output; } + else if (Object::has_extension($class, 'Versioned')) { + $table = singleton($class)->baseTable() . '_Live'; + if (DB::getConn()->hasTable($table)) { + $instances = Versioned::get_by_stage($class, 'Live'); + } + else { + $instances = new DataList($class); + } + } else { $instances = new DataList($class); }