diff --git a/code/extensions/DocumentationViewerVersionWarning.php b/code/extensions/DocumentationViewerVersionWarning.php index 7a7351b..b5bd7cc 100644 --- a/code/extensions/DocumentationViewerVersionWarning.php +++ b/code/extensions/DocumentationViewerVersionWarning.php @@ -30,17 +30,17 @@ class DocumentationViewerVersionWarning extends Extension { $stable = $this->owner->getManifest()->getStableVersion($entity); $compare = $entity->compare($stable); - + if($entity->getVersion() == "master" || $compare > 0) { return $this->owner->customise(new ArrayData(array( 'FutureRelease' => true, - 'StableVersion' => DBField::create_field('HTMLText', $stable) + 'StableVersion' => DBField::create_field('HTMLText', $stable->getVersion()) ))); } else { return $this->owner->customise(new ArrayData(array( 'OutdatedRelease' => true, - 'StableVersion' => DBField::create_field('HTMLText', $stable) + 'StableVersion' => DBField::create_field('HTMLText', $stable->getVersion()) ))); } diff --git a/templates/Includes/DocumentationVersion_warning.ss b/templates/Includes/DocumentationVersion_warning.ss index 090c8d7..a77bca3 100644 --- a/templates/Includes/DocumentationVersion_warning.ss +++ b/templates/Includes/DocumentationVersion_warning.ss @@ -2,9 +2,9 @@
This document contains information for an outdated version <% if Top.Version %>($Top.Version)<% end_if %> and may not be maintained any more. If some of your projects still use this version, consider upgrading as soon as possible.
+This document contains information for an outdated version <% if $Version %>($Version)<% end_if %> and may not be maintained any more. If some of your projects still use this version, consider upgrading as soon as possible.
<% else_if FutureRelease %> -This document contains information about a future release <% if StableVersion %>and not the current stable version ($StableVersion)<% end_if %>. Be aware that information on this page may change and API's may not be stable for production use.
+This document contains information about a future release <% if $VersionWarning.StableVersion %>and not the current stable version ($VersionWarning.StableVersion)<% end_if %>. Be aware that information on this page may change and API's may not be stable for production use.
<% end_if %> <% end_loop %>