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(class_exists('SiteTree')) {
|
||||||
if(!$this->config()->get('disable_sitetree_export')) {
|
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)) {
|
if(!in_array('SiteTree', $objs)) {
|
||||||
$objs[] = "SiteTree";
|
$objs[] = "SiteTree";
|
||||||
@ -232,9 +235,13 @@ class StaticExporter extends Controller {
|
|||||||
$urls = array();
|
$urls = array();
|
||||||
|
|
||||||
foreach($classes as $obj) {
|
foreach($classes as $obj) {
|
||||||
$link = $obj->Link;
|
if (!class_exists($obj)) {
|
||||||
|
continue;
|
||||||
$urls[$link] = $link;
|
}
|
||||||
|
foreach ($obj::get() as $objInstance) {
|
||||||
|
$link = $objInstance->Link();
|
||||||
|
$urls[$link] = $link;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->extend('alterExportUrls', $urls);
|
$this->extend('alterExportUrls', $urls);
|
||||||
|
Loading…
Reference in New Issue
Block a user