From fb9d7a595b20c0ff658c26e6d25c4ff128e5e1d5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 1 Oct 2013 11:17:36 +0200 Subject: [PATCH 1/2] FIX ReportAdmin report links regression Regression from 79996a76fe55bd95a99dd99aae5c5f27626f0f06, escaped quotes are no longer necessary because the string doesn't get eval'ed. --- code/controllers/ReportAdmin.php | 2 +- tests/behat/features/view-reports.feature | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/behat/features/view-reports.feature diff --git a/code/controllers/ReportAdmin.php b/code/controllers/ReportAdmin.php index 05fb82c3..969df6d2 100644 --- a/code/controllers/ReportAdmin.php +++ b/code/controllers/ReportAdmin.php @@ -166,7 +166,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider { $columns->setFieldFormatting(array( 'title' => function($value, &$item) { return sprintf( - '%s', + '%s', Convert::raw2xml($item->Link), Convert::raw2xml($value) ); diff --git a/tests/behat/features/view-reports.feature b/tests/behat/features/view-reports.feature new file mode 100644 index 00000000..a51fe80a --- /dev/null +++ b/tests/behat/features/view-reports.feature @@ -0,0 +1,15 @@ +Feature: View Reports + As an author + I want to review aggregate reports on pages + So that I can keep an overview on the health of my website data + + Background: + Given a "page" "Empty Page" + And a "page" "Filled Page" with "Content"="Some Content" + And I am logged in with "ADMIN" permissions + And I go to "/admin/reports" + + Scenario: I can view the "Pages with no content" report + When I follow "Pages with no content" + Then I should see "Empty Page" + But I should not see "Filled Page" \ No newline at end of file From 52ab9e570a806b22b8b9d53a3a4c73d1b17389bf Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 2 Oct 2013 11:52:14 +0200 Subject: [PATCH 2/2] Fixed report link escaping --- code/reports/Report.php | 2 +- tests/behat/features/view-reports.feature | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/reports/Report.php b/code/reports/Report.php index 85b1f03a..171320b3 100644 --- a/code/reports/Report.php +++ b/code/reports/Report.php @@ -284,7 +284,7 @@ class SS_Report extends ViewableData { if(isset($info['link']) && $info['link']) { $fieldFormatting[$source] = function($value, &$item) { return sprintf( - '%s', + '%s', Controller::join_links(singleton('CMSPageEditController')->Link('show'), $item->ID), Convert::raw2xml($value) ); diff --git a/tests/behat/features/view-reports.feature b/tests/behat/features/view-reports.feature index a51fe80a..837eb66a 100644 --- a/tests/behat/features/view-reports.feature +++ b/tests/behat/features/view-reports.feature @@ -12,4 +12,7 @@ Feature: View Reports Scenario: I can view the "Pages with no content" report When I follow "Pages with no content" Then I should see "Empty Page" - But I should not see "Filled Page" \ No newline at end of file + But I should not see "Filled Page" + When I follow "Empty Page" + Then I should see an edit page form + And the "Page name" field should contain "Empty Page" \ No newline at end of file