From 57cfe3c66a5d67e88bbb1d4150329c6d4841f683 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 18 Mar 2016 11:03:26 +0000 Subject: [PATCH 1/2] FIX Bad joining of links in reports --- code/SideReport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/SideReport.php b/code/SideReport.php index 61832feb..80ae94d4 100644 --- a/code/SideReport.php +++ b/code/SideReport.php @@ -88,8 +88,8 @@ class SideReportView extends ViewableData { } if(isset($info['link']) && $info['link']) { - $linkBase = singleton('CMSPageEditController')->Link('show') . '/'; - $link = ($info['link'] === true) ? $linkBase . $record->ID : $info['link']; + $linkBase = singleton('CMSPageEditController')->Link('show'); + $link = ($info['link'] === true) ? Controller::join_links($linkBase, $record->ID) : $info['link']; return $prefix . "$val"; } else { return $prefix . "$val"; From b1566f3e79d9a60d022d4d2c01a17d9694886fab Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 18 Mar 2016 11:07:35 +0000 Subject: [PATCH 2/2] Decoupling from CMS module --- .travis.yml | 3 --- code/SideReport.php | 5 +++-- composer.json | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e3c2f8c9..da8deaef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ php: - 5.4 - 5.5 - 5.6 - - 7.0 env: - DB=MYSQL CORE_RELEASE=3.2 @@ -20,8 +19,6 @@ matrix: env: DB=MYSQL CORE_RELEASE=3 - php: 5.6 env: DB=PGSQL CORE_RELEASE=3.2 - allow_failures: - - php: 7.0 before_script: - composer self-update || true diff --git a/code/SideReport.php b/code/SideReport.php index 80ae94d4..29513b48 100644 --- a/code/SideReport.php +++ b/code/SideReport.php @@ -88,8 +88,9 @@ class SideReportView extends ViewableData { } if(isset($info['link']) && $info['link']) { - $linkBase = singleton('CMSPageEditController')->Link('show'); - $link = ($info['link'] === true) ? Controller::join_links($linkBase, $record->ID) : $info['link']; + $link = ($info['link'] === true && $record->hasMethod('CMSEditLink')) + ? $record->CMSEditLink() + : $info['link']; return $prefix . "$val"; } else { return $prefix . "$val"; diff --git a/composer.json b/composer.json index bc2941a6..57bd6608 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.3.3,<7", "silverstripe/framework": "~3.2" }, "require-dev": {