Merge pull request #38 from ss23/master

Fix static exporter to export URLs properly
This commit is contained in:
Mateusz U 2015-01-09 12:01:47 +13:00
commit 3e14e51643

View File

@ -47,7 +47,10 @@ class StaticExporter extends Controller {
if(class_exists('SiteTree')) {
if(!$this->config()->get('disable_sitetree_export')) {
$objs[] = $this->config()->export_objects;
$objs = $this->config()->export_objects;
if (!is_array($objs)) {
$objs = array($objs);
}
if(!in_array('SiteTree', $objs)) {
$objs[] = "SiteTree";
@ -232,10 +235,14 @@ class StaticExporter extends Controller {
$urls = array();
foreach($classes as $obj) {
$link = $obj->Link;
if (!class_exists($obj)) {
continue;
}
foreach ($obj::get() as $objInstance) {
$link = $objInstance->Link();
$urls[$link] = $link;
}
}
$this->extend('alterExportUrls', $urls);