mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
Merge pull request #38 from ss23/master
Fix static exporter to export URLs properly
This commit is contained in:
commit
3e14e51643
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user