From 7ec9596b995997e4c63fb55a566d37376163f239 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 27 Sep 2013 19:38:12 +0200 Subject: [PATCH 01/13] CMSMain assertion fail due to escaping Validation messages are now HTML entity escaped when output to the user, the assertion needs to reflect that --- tests/controller/CMSMainTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/controller/CMSMainTest.php b/tests/controller/CMSMainTest.php index f7dbb0b2..c2acf523 100644 --- a/tests/controller/CMSMainTest.php +++ b/tests/controller/CMSMainTest.php @@ -302,7 +302,7 @@ class CMSMainTest extends FunctionalTest { ); $this->assertFalse($response->isError()); $this->assertContains( - _t('SiteTree.PageTypeNotAllowed', array('type' => 'Page')), + htmlentities(_t('SiteTree.PageTypeNotAllowed', array('type' => 'Page'))), $response->getBody() ); From c2a34ff4a744a0c140bf63775faded44c1718649 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 1 Oct 2013 00:05:08 +0200 Subject: [PATCH 02/13] Updated translations --- lang/nl.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/nl.yml b/lang/nl.yml index 3dac0d14..5987de85 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -207,7 +207,7 @@ nl: 504: '504 - Gateway Timeout' 505: '505 - HTTP Versie Niet Ondersteund' CODE: 'Foutcode' - DEFAULTERRORPAGECONTENT: '

Sorry, maar de pagina die je zocht lijkt niet te bestaan.

Gelieve de spelling van de url te controleren en het opnieuw te proberen.

' + DEFAULTERRORPAGECONTENT: '

Helaas, de pagina die u zocht lijkt niet (meer) te bestaan.

Controleer of de juiste URL is gebruikt en probeer het opnieuw.

' DEFAULTERRORPAGETITLE: 'Pagina niet gevonden' DEFAULTSERVERERRORPAGECONTENT: '

Helaas, er was een probleem bij het verwerken van je verzoek.

' DEFAULTSERVERERRORPAGETITLE: 'Probleem met de server' @@ -266,7 +266,7 @@ nl: ParameterLiveCheckbox: 'Controleer gepubliceerde site' REPEMPTY: 'Het {title} rapport is leeg.' SilverStripeNavigatorLink: - ShareInstructions: 'Kopieer en plak de link hieronder, om een link te delen op deze pagina.' + ShareInstructions: 'Kopieer en plak de link hieronder, om deze pagina te delen.' ShareLink: 'Deel een link' SilverStripeNavigatorLinkl: CloseLink: Sluiten From daf92e6ce0313b6a2debef6e1b03550104202e99 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 1 Oct 2013 11:17:36 +0200 Subject: [PATCH 03/13] 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 946633ca..9e57ced5 100644 --- a/code/controllers/ReportAdmin.php +++ b/code/controllers/ReportAdmin.php @@ -168,7 +168,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 1f4cdfced89d0bef86df51cc8374f86d069dea79 Mon Sep 17 00:00:00 2001 From: Andrew Short Date: Wed, 2 Oct 2013 15:03:50 +1000 Subject: [PATCH 04/13] Fix test sometimes using cached relationship object. In some circumstances, the CopyContentFrom page will be cached, so when it is accessed the incorrect value was returned, meaning the test would fail. --- tests/model/VirtualPageTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/model/VirtualPageTest.php b/tests/model/VirtualPageTest.php index ac4e9279..36ff59c5 100644 --- a/tests/model/VirtualPageTest.php +++ b/tests/model/VirtualPageTest.php @@ -499,6 +499,8 @@ class VirtualPageTest extends SapphireTest { $virtual = DataObject::get_by_id('VirtualPage', $virtual->ID, false); $virtual->CopyContentFromID = $notRootPage->ID; + $virtual->flushCache(); + $isDetected = false; try { $virtual->write(); From fb9d7a595b20c0ff658c26e6d25c4ff128e5e1d5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 1 Oct 2013 11:17:36 +0200 Subject: [PATCH 05/13] 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 06/13] 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 From 92e0c410b8c3db09c394916ace4ecb89b61f7ddb Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 2 Oct 2013 11:52:14 +0200 Subject: [PATCH 07/13] 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 09e3ce0c..54099e2f 100644 --- a/code/reports/Report.php +++ b/code/reports/Report.php @@ -303,7 +303,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 From 26b086c3f7e3f618cb651d150aa6fcb805994552 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 2 Oct 2013 12:24:23 +0200 Subject: [PATCH 08/13] Escape pl_PL.js (fixes #859) --- javascript/lang/pl_PL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/lang/pl_PL.js b/javascript/lang/pl_PL.js index d5b4df54..668e97e6 100644 --- a/javascript/lang/pl_PL.js +++ b/javascript/lang/pl_PL.js @@ -19,7 +19,7 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { 'CMSMAIN.ERRORREVERTING': 'Błąd podczas powrotu do opublikowanej strony', 'CMSMAIN.SAVING' : 'Zapisywanie...', 'CMSMAIN.SELECTMOREPAGES' : "Zaznaczono %s stron.\n\nCzy na pewno chcesz wykonać tę akcje?", - 'CMSMAIN.ALERTCLASSNAME': 'Ta strona zostanie zaktualizowana po jej zapisani'ur, + 'CMSMAIN.ALERTCLASSNAME': 'Ta strona zostanie zaktualizowana po jej zapisani\'ur', 'CMSMAIN.URLSEGMENTVALIDATION': 'Adres URL może składać się tylko z liter, cyfr i łączników.', 'AssetAdmin.BATCHACTIONSDELETECONFIRM': "Czy na pewno usunąć %s folderów?", 'AssetTableField.REALLYDELETE': 'Czy na pewno usunąć zaznaczone pliki??', From 595a0375e7abf25f5144f244f0063f95b2fed611 Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Thu, 13 Dec 2012 11:47:21 +0000 Subject: [PATCH 09/13] Stop MenuTitle updating tree on change If the MenuTitle is changed and the tree updates, not saving the changes to the page leaves the tree with the new title instead of the old, correct one (until a refresh). This also seems counter-intuitive anyway - suggesting to users that their updated MenuTitle has been saved before it actually has. --- javascript/CMSMain.EditForm.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index 1f42136d..60feab42 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -130,40 +130,6 @@ updateURLFromTitle.hide(); } }); - - /** - * MenuTitle - */ - $('.cms-edit-form input[name=MenuTitle]').entwine({ - onchange: function() { - this.updatedRelatedFields(); - }, - - /** - * Same as the onchange handler but callable as a method - */ - updatedRelatedFields: function() { - var menuTitle = this.val(); - this.updateTreeLabel(menuTitle); - }, - - /** - * Function: updatePanelLabels - * - * Update the tree - * (String) title - */ - updateTreeLabel: function(title) { - var pageID = $('.cms-edit-form input[name=ID]').val(); - - // only update immediate text element, we don't want to update all the nested ones - var treeItem = $('.item:first', $('.cms-tree').find("[data-id='" + pageID + "']")); - if (title && title != "") { - treeItem.text(title); - } - } - - }); /** * Class: .cms-edit-form .parentTypeSelector From 0437c0597d4682c3801c582d5c14b86f8686b813 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 2 Oct 2013 17:12:43 +0200 Subject: [PATCH 10/13] More resilient Behat checks for "page not found" Wrapping in a step to capture cases where the ErrorPage defaults haven't been generated, and the default ModelAsController message shows which is slightly different wording. --- tests/behat/features/publish-a-page.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/behat/features/publish-a-page.feature b/tests/behat/features/publish-a-page.feature index 5a1d3337..ce5927c1 100644 --- a/tests/behat/features/publish-a-page.feature +++ b/tests/behat/features/publish-a-page.feature @@ -10,7 +10,7 @@ So that only high quality changes are seen by our visitors @javascript Scenario: I can have a unpublished version of a page that is not publicly available Given I go to "/my-page" - Then I should see "Page not found" + Then the page can't be found @javascript Scenario: I can publish a previously never published page @@ -68,7 +68,7 @@ So that only high quality changes are seen by our visitors Then I press the "Log out" button And I go to "/hello" - Then I should see "Page not found" + Then the page can't be found @javascript Scenario: I can delete a page from live and draft stage to completely remove it From 0d2d293c028482cab845ded70e950c784a869e6e Mon Sep 17 00:00:00 2001 From: Shea Dawson Date: Thu, 3 Oct 2013 14:20:54 +1300 Subject: [PATCH 11/13] BUGFIX check if hints are defined for given pagetype before using. Fixes #861 --- javascript/CMSMain.Tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/CMSMain.Tree.js b/javascript/CMSMain.Tree.js index a8b28f7a..4774d9f0 100644 --- a/javascript/CMSMain.Tree.js +++ b/javascript/CMSMain.Tree.js @@ -68,7 +68,7 @@ // Build a list for allowed children as submenu entries var pagetype = node.data('pagetype'), id = node.data('id'), - disallowedChildren = hints[pagetype].disallowedChildren, + disallowedChildren = (typeof hints[pagetype] != 'undefined') ? hints[pagetype].disallowedChildren : null, allowedChildren = $.extend(true, {}, hints['All']), // clone disallowedClass, menuAllowedChildren = {}, From 648c2072e8e966aebe4e2e18c53f9b82a3bdea5e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 4 Oct 2013 12:38:27 +0200 Subject: [PATCH 12/13] updated translations --- lang/ar.yml | 8 ++------ lang/az.yml | 4 +--- lang/es_MX.yml | 6 +----- lang/sl.yml | 13 ++----------- lang/vi_VN.yml | 6 +----- 5 files changed, 7 insertions(+), 30 deletions(-) diff --git a/lang/ar.yml b/lang/ar.yml index e7a17bb9..ff608678 100644 --- a/lang/ar.yml +++ b/lang/ar.yml @@ -135,9 +135,7 @@ ar: DEFAULTTHEME: '( استخدام الثيم الافتراضي )' EDITHEADER: 'من يستطيع تحرير الصفحات الموجودة على هذا الموقع؟' EDIT_PERMISSION: 'إدارة إعدادات الموقع' - EDIT_PERMISSION_HELP: 'القدرة على تحرير إعدادات الوصول العالمي / أذونات صفحة المستوى الأعلى. - - ' + EDIT_PERMISSION_HELP: 'القدرة على تحرير إعدادات الوصول العالمي / أذونات صفحة المستوى الأعلى.' SITENAMEDEFAULT: 'اسم عنوان موقعك' SITETAGLINE: 'علامة / شعار الموقع' SITETITLE: 'عنوان الموقع' @@ -193,9 +191,7 @@ ar: PERMISSION_GRANTACCESS_DESCRIPTION: 'التحكم في المجموعات التي لها صلاحية الدخول أو التعديل على صفحات محددة' PERMISSION_GRANTACCESS_HELP: 'السماح بضع القيود على الوصول صفحة محددة في قسم "الصفحات".' REORGANISE_DESCRIPTION: 'Can reorganise the site tree' - REORGANISE_HELP: 'إعادة ترتيب الصفحات في شجرة الموقع من خلال السحب والإسقاط. - - ' + REORGANISE_HELP: 'إعادة ترتيب الصفحات في شجرة الموقع من خلال السحب والإسقاط.' SHOWINMENUS: 'عرض في قوائم ؟' SHOWINSEARCH: 'عرض في البحث ؟' TABBEHAVIOUR: الشسلوك diff --git a/lang/az.yml b/lang/az.yml index 2d12db8a..bebe3098 100644 --- a/lang/az.yml +++ b/lang/az.yml @@ -18,9 +18,7 @@ az: ErrorPage: 501: '501 - Implementasiya olunmayıb' CODE: 'Səhv kodu' - DEFAULTERRORPAGECONTENT: '

Üzr istəyirik, görünür siz mövcud olan səhifəyə giriş əldə etməyə cəhd edirdiniz.

Xahiş sizin giriş əldə etməyə və bir daha sınaqdan keçirməyə cəhd etdiyiniz URL-i yoxlayasınız

- - ' + DEFAULTERRORPAGECONTENT: '

Üzr istəyirik, görünür siz mövcud olan səhifəyə giriş əldə etməyə cəhd edirdiniz.

Xahiş sizin giriş əldə etməyə və bir daha sınaqdan keçirməyə cəhd etdiyiniz URL-i yoxlayasınız

' DEFAULTERRORPAGETITLE: 'Səhifə tapılmadı' Folder: DELETEUNUSEDTHUMBNAILS: 'İşlənməyən şəkilləri sil' diff --git a/lang/es_MX.yml b/lang/es_MX.yml index 0b54c942..1ca95716 100644 --- a/lang/es_MX.yml +++ b/lang/es_MX.yml @@ -147,11 +147,7 @@ es_MX: DEFAULTABOUTTITLE: 'Sobre nosotros' DEFAULTCONTACTCONTENT: '

Usted puede llenar esta págna con su propio contenido, o eliminarla y crear sus propias páginas.

' DEFAULTCONTACTTITLE: 'Contacto' - DEFAULTHOMECONTENT: '

¡Bienvenido a SilverStripe! Ésta es la página de Inicio predeterminada. Usted puede modificar esta página abriendo el CMS. Ahora puede navegar por la - - documentación del desarrollador, o comenzar los tutoriales

. - - ' + DEFAULTHOMECONTENT: '

¡Bienvenido a SilverStripe! Ésta es la página de Inicio predeterminada. Usted puede modificar esta página abriendo el CMS. Ahora puede navegar por la documentación del desarrollador, o comenzar los tutoriales

.' DEFAULTHOMETITLE: Inicio DEPENDENT_NOTE: 'Las siguientes páginas depender de esta página. Esto incluye páginas virtuales, redirección de páginas y páginas con enlaces de contenido.' DependtPageColumnLinkType: 'Tipo de enlace' diff --git a/lang/sl.yml b/lang/sl.yml index e0264a60..b438cb57 100644 --- a/lang/sl.yml +++ b/lang/sl.yml @@ -114,12 +114,7 @@ sl: ARCHIVEDSITE: 'Predogled različice' ARCHIVEDSITEFROM: 'Arhivirana različica iz' DRAFTSITE: 'Osnutek spletnega mesta' - DRAFT_SITE_ACCESS_RESTRICTION: 'Za ogled osnutka vsebine ali arhiva tega spletnega mesta, se morate prijaviti s podatki za dostop do CMS-vmesnika. - - - Nazaj na objavljeno različico spletnega mesta. - - ' + DRAFT_SITE_ACCESS_RESTRICTION: 'Za ogled osnutka vsebine ali arhiva tega spletnega mesta, se morate prijaviti s podatki za dostop do CMS-vmesnika. Nazaj na objavljeno različico spletnega mesta.' Email: E-naslov INSTALL_SUCCESS: 'Namestitev je bila uspešna!' InstallFilesDeleted: 'Namestitvene datoteke so bile uspešno izbrisane.' @@ -158,11 +153,7 @@ sl: 504: 'Napaka 504: Čas za dostop je potekel' 505: 'Napaka 505: Strežnik ne podpira HTTP-različice zahtevka' CODE: 'Napačna koda' - DEFAULTERRORPAGECONTENT: '

Morda ste zahtevali dostop do strani, ki ne obstaja?

- -

Za vsak slučaj preverite vpisani URL-naslov in poskusite ponovno.

- - ' + DEFAULTERRORPAGECONTENT: '

Morda ste zahtevali dostop do strani, ki ne obstaja?

Za vsak slučaj preverite vpisani URL-naslov in poskusite ponovno.

' DEFAULTERRORPAGETITLE: 'Strani ni mogoče najti' DEFAULTSERVERERRORPAGECONTENT: '

Oprostite, pri vaši zahtevi je prišlo do težave.

' DEFAULTSERVERERRORPAGETITLE: 'Napaka na strežniku' diff --git a/lang/vi_VN.yml b/lang/vi_VN.yml index b4298224..81fc3388 100644 --- a/lang/vi_VN.yml +++ b/lang/vi_VN.yml @@ -4,11 +4,7 @@ vi_VN: SAVE: Lưu ErrorPage: CODE: 'Mã lỗi' - DEFAULTERRORPAGECONTENT: '

Bạn truy cập vào một trang không tồn tại

- -

Xin vui lòng kiểm tra lại đường dẩn hoặc quay lại trang chủ

- - ' + DEFAULTERRORPAGECONTENT: '

Bạn truy cập vào một trang không tồn tại

Xin vui lòng kiểm tra lại đường dẩn hoặc quay lại trang chủ

' DEFAULTERRORPAGETITLE: 'Không tìm thấy' RedirectorPage: HASBEENSETUP: 'Một trang di chuyển chưa cấu hình đích di chuyển đến.' From e836bbb90728996108cb5faf8dba4c204506ec39 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 6 Oct 2013 19:02:41 +0200 Subject: [PATCH 13/13] Renamed "ja_JP" locale to "ja" Better compat with transifex with generic locale --- lang/{ja_JP.yml => ja.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename lang/{ja_JP.yml => ja.yml} (99%) diff --git a/lang/ja_JP.yml b/lang/ja.yml similarity index 99% rename from lang/ja_JP.yml rename to lang/ja.yml index 9a9aa72e..56b2b811 100644 --- a/lang/ja_JP.yml +++ b/lang/ja.yml @@ -1,4 +1,4 @@ -ja_JP: +ja: AssetAdmin: ADDFILES: 'ファイルを追加' ActionAdd: 'フォルダを追加'