mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
Fix static exporter to export URLs properly
This commit is contained in:
parent
76ba1a8b25
commit
e496341b70
@ -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,9 +235,13 @@ class StaticExporter extends Controller {
|
||||
$urls = array();
|
||||
|
||||
foreach($classes as $obj) {
|
||||
$link = $obj->Link;
|
||||
|
||||
$urls[$link] = $link;
|
||||
if (!class_exists($obj)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($obj::get() as $objInstance) {
|
||||
$link = $objInstance->Link();
|
||||
$urls[$link] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
$this->extend('alterExportUrls', $urls);
|
||||
|
Loading…
Reference in New Issue
Block a user