From aa748113e3583715f07b07043d02b97c5fdcd2d9 Mon Sep 17 00:00:00 2001 From: Ladislav Kubes Date: Thu, 9 Jun 2011 11:34:08 +0200 Subject: [PATCH 01/14] CZ translation for tinymce_ssbuttons plugin --- javascript/tinymce_ssbuttons/langs/cs.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 javascript/tinymce_ssbuttons/langs/cs.js diff --git a/javascript/tinymce_ssbuttons/langs/cs.js b/javascript/tinymce_ssbuttons/langs/cs.js new file mode 100644 index 00000000..5f8cfec0 --- /dev/null +++ b/javascript/tinymce_ssbuttons/langs/cs.js @@ -0,0 +1,5 @@ +tinyMCE.addI18n('cs.tinymce_ssbuttons', { +insertlink: 'Vložit odkaz', +insertimage: 'Vložit obrázek', +insertflash: 'Vložit Flash animaci' +}); \ No newline at end of file From 5d3ddafbd8cb69cbfd4ee846a413a6ab79948b9a Mon Sep 17 00:00:00 2001 From: Ladislav Kubes Date: Thu, 9 Jun 2011 16:18:35 +0200 Subject: [PATCH 02/14] Add some translation in cms core --- code/CMSMain.php | 2 +- lang/cs_CZ.php | 1 + lang/en_US.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index f636617d..bac17118 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -377,7 +377,7 @@ JS; $siteConfig = SiteConfig::current_site_config(); $form->saveInto($siteConfig); $siteConfig->write(); - FormResponse::status_message('Saved site configuration', "good"); + FormResponse::status_message(_t('CMSMain.SAVEDSITECONFIGURATION', 'Saved site configuration'), "good"); FormResponse::add("$('Form_EditForm').resetElements();"); $title = Convert::raw2js($siteConfig->Title); diff --git a/lang/cs_CZ.php b/lang/cs_CZ.php index f81c9bf6..8757f96f 100644 --- a/lang/cs_CZ.php +++ b/lang/cs_CZ.php @@ -155,6 +155,7 @@ $lang['cs_CZ']['CMSMain']['VIEWING'] = 'Prohlížíte verzi #%s, vytvořenou %s $lang['cs_CZ']['CMSMain']['VISITRESTORE'] = 'navštívit restorepage/(ID)'; $lang['cs_CZ']['CMSMain']['WAITINGON'] = 'Čekáte na jiné lidi, než dokončí práci na těchto %d stránkách.'; $lang['cs_CZ']['CMSMain']['WORKTODO'] = 'Máte na těchto %d stránkách práci k udělání.'; +$lang['cs_CZ']['CMSMain']['SAVEDSITECONFIGURATION'] = 'Nastavení stránky uloženo'; $lang['cs_CZ']['CMSMain_dialog.ss']['BUTTONNOTFOUND'] = 'Systém nemůže nelézt jméno tlačítka'; $lang['cs_CZ']['CMSMain_dialog.ss']['NOLINKED'] = 'Nemůžete najít objekt window.linkedObject pro zaslání kliknutí na tlačítko zpět do hlavního okna.'; $lang['cs_CZ']['CMSMain_left.ss']['ADDEDNOTPUB'] = 'Přidáno do konceptů, ale ještě nezveřejněno'; diff --git a/lang/en_US.php b/lang/en_US.php index 9c1eb5e4..4f6100a7 100755 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -154,6 +154,7 @@ $lang['en_US']['CMSMain']['VIEWING'] = array( PR_MEDIUM, 'Version number is a linked string, created is a relative time (e.g. 2 days ago), by a specific author' ); +$lang['en_US']['CMSMain']['SAVEDSITECONFIGURATION'] = 'Saved site configuration'; $lang['en_US']['CMSMain_dialog.ss']['BUTTONNOTFOUND'] = 'Couldn\'t find the button name'; $lang['en_US']['CMSMain_dialog.ss']['NOLINKED'] = 'Can\'t find window.linkedObject to send the button click back to the main window'; $lang['en_US']['CMSMain_left.ss']['ADDEDNOTPUB'] = 'Added to the draft site and not published yet'; From 1f0277b78166d0f4910ee1539d29f951740a641c Mon Sep 17 00:00:00 2001 From: Ladislav Kubes Date: Thu, 9 Jun 2011 17:21:49 +0200 Subject: [PATCH 03/14] Add some missing CZ translations in cms javascript --- javascript/lang/cs_CZ.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/javascript/lang/cs_CZ.js b/javascript/lang/cs_CZ.js index a915f502..9f5702fe 100644 --- a/javascript/lang/cs_CZ.js +++ b/javascript/lang/cs_CZ.js @@ -26,6 +26,15 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { 'ModelAdmin.REALLYDELETE': "Skutečně chcete smazat?", 'ModelAdmin.DELETED': "Smazáno", 'LeftAndMain.PAGEWASDELETED': "Tato stránka byla smazána. Pro editaci stránky, vyberte ji vlevo.", - 'LeftAndMain.CONFIRMUNSAVED': "Určitě chcete opustit navigaci z této stránky?\n\nUPOZORNĚNÍ: Vaše změny nebyly uloženy.\n\nStlačte OK pro pokračovat, nebo Cancel, zůstanete na této stránce." + 'LeftAndMain.CONFIRMUNSAVED': "Určitě chcete opustit navigaci z této stránky?\n\nUPOZORNĚNÍ: Vaše změny nebyly uloženy.\n\nStlačte OK pro pokračovat, nebo Cancel, zůstanete na této stránce.", + 'WidgetAreaEditor.TOOMANY': 'Dosažen limit doplňků pro tuto oblast', + 'CMSMAIN.RollbackConfirmation': 'Opravdu chcete vrátit stav této stránky na verzi #%s?', + 'CMSMAIN.CopyPublishedConfirmation': 'Opravdu chcete zkopírovat publikovaný obsah do konceptu stránky?', + 'CMSMAIN.PageTypeSaveAlert': 'Typ stránky bude změněn po jejím uložení.', + 'LOADING': 'načítání...', + 'TABLEFIELD.DELETECONFIRMMESSAGEV2': '\nExistuje %s stránek, které tento soubor používají, zkontrolujte jejich seznam na záložce odkazy, než budete pokračovat.', + 'TABLEFIELD.SELECTUPLOAD': 'Vyberte, prosím, alespoň jeden soubor k narhární.', + 'TABLEFIELD.SELECTDELETE': 'Vyberte soubory ke smazání!', + 'TABLEFIELD.CONFIRMDELETEV2': 'Opravdu chcete smazat označené soubory?' }); } \ No newline at end of file From af0bf453b24356b7f5bea251ce1f467f2f961427 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 31 Aug 2011 10:31:33 +1200 Subject: [PATCH 04/14] BUGFIX: fixing random changing of access tab radio buttons when refreshing the CMS with a URL such as /admin#Root_Access in Firefox. --- javascript/LeftAndMain.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index 35d700cd..778c63b4 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -7,6 +7,13 @@ if(typeof(jQuery) != 'undefined') { $(document).ready(function() { window.onresize(true); }); + + //Turn off autocomplete to fix the access tab randomly switching radio buttons in Firefox when refresh the page + // with an anchor tag in the URL. E.g: /admin#Root_Access + //Autocomplete in the CMS also causes strangeness in other browsers, so this turns it off for all browsers. + //see the following for demo and explanation of the Firefox bug: + // http://www.ryancramer.com/journal/entries/radio_buttons_firefox/ + $("#Form_EditForm").attr("autocomplete", "off"); })(jQuery); } From b5ea2f68feab41f969a2e6f0589dd55015f74098 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 15 Sep 2011 14:36:47 +0200 Subject: [PATCH 05/14] BUGFIX Consistently using Convert::raw2sql() instead of DB::getConn()->addslashes() or PHP's deprecated addslashes() for database escaping --- code/AssetAdmin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index 9939220d..bd5064c9 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -378,7 +378,7 @@ HTML; public function movemarked($urlParams, $form) { if($_REQUEST['DestFolderID'] && (is_numeric($_REQUEST['DestFolderID']) || ($_REQUEST['DestFolderID']) == 'root')) { $destFolderID = ($_REQUEST['DestFolderID'] == 'root') ? 0 : $_REQUEST['DestFolderID']; - $fileList = "'" . ereg_replace(' *, *',"','",trim(addslashes($_REQUEST['FileIDs']))) . "'"; + $fileList = "'" . ereg_replace(' *, *',"','",trim(Convert::raw2sql($_REQUEST['FileIDs']))) . "'"; $numFiles = 0; if($fileList != "''") { @@ -411,7 +411,7 @@ HTML; * Called and returns in same way as 'save' function */ public function deletemarked($urlParams, $form) { - $fileList = "'" . ereg_replace(' *, *',"','",trim(addslashes($_REQUEST['FileIDs']))) . "'"; + $fileList = "'" . ereg_replace(' *, *',"','",trim(Convert::raw2sql($_REQUEST['FileIDs']))) . "'"; $numFiles = 0; $folderID = 0; $deleteList = ''; From d15e8509b01ff2dbbe3028a055021a29b1065b22 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 8 Sep 2011 17:56:47 +0200 Subject: [PATCH 06/14] SECURITY Using JSON instead of serialize() to stringify user data in PageCommentsInterface --- code/sitefeatures/PageCommentInterface.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index 84568ec8..92823f4c 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -222,7 +222,7 @@ class PageCommentInterface extends RequestHandler { foreach($fields as $field) { if(!$field instanceof HiddenField) $visibleFields[] = $field->Name(); } - $form->loadDataFrom(unserialize($cookie), false, $visibleFields); + $form->loadDataFrom(Convert::json2array($cookie), false, $visibleFields); } return $form; @@ -272,7 +272,7 @@ class PageCommentInterface extends RequestHandler { */ class PageCommentInterface_Form extends Form { function postcomment($data) { - Cookie::set("PageCommentInterface_Data", serialize($data)); + Cookie::set("PageCommentInterface_Data", Convert::raw2json($data)); // Spam filtering if(SSAkismet::isEnabled()) { @@ -333,7 +333,7 @@ class PageCommentInterface_Form extends Form { $comment->write(); unset($data['Comment']); - Cookie::set("PageCommentInterface_Data", serialize($data)); + Cookie::set("PageCommentInterface_Data", Convert::raw2json($data)); $moderationMsg = _t('PageCommentInterface_Form.AWAITINGMODERATION', "Your comment has been submitted and is now awaiting moderation."); From bb757d13a4142a4b0fab680240bde1a064c338a4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 15 Sep 2011 16:17:47 +0200 Subject: [PATCH 07/14] ENHANCEMENT Allow editing of new File.ShowInSearch flag through AssetTableField --- code/AssetTableField.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/AssetTableField.php b/code/AssetTableField.php index 7d822cf0..84da21ed 100755 --- a/code/AssetTableField.php +++ b/code/AssetTableField.php @@ -194,6 +194,12 @@ class AssetTableField extends ComplexTableField { ) ); } + + if(!($childData instanceof Folder)) { + $mainTab->push( + new CheckboxField("ShowInSearch", $childData->fieldLabel('ShowInSearch')) + ); + } if($childData && $childData->hasMethod('BackLinkTracking')) { if(class_exists('Subsite')) Subsite::disable_subsite_filter(true); From 4abe136db5955de9dd263821f8db65d5b3e0db25 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 1 Feb 2012 18:30:24 +0100 Subject: [PATCH 08/14] API CHANGE silverstripe_version file now contains the plain version number, rather than an SVN path --- code/LeftAndMain.php | 27 +++++++-------------------- silverstripe_version | 1 - tests/LeftAndMainTest.php | 19 ------------------- 3 files changed, 7 insertions(+), 40 deletions(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 8e050593..c9c498eb 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -1109,34 +1109,21 @@ JS; /** * Return the version number of this application. * Uses the subversion path information in /silverstripe_version - * (automacially replaced $URL$ placeholder). + * (automacially replaced by build scripts). * * @return string */ public function CMSVersion() { - $sapphireVersionFile = file_get_contents(BASE_PATH . '/sapphire/silverstripe_version'); - $cmsVersionFile = file_get_contents(BASE_PATH . '/cms/silverstripe_version'); - - $sapphireVersion = $this->versionFromVersionFile($sapphireVersionFile); - $cmsVersion = $this->versionFromVersionFile($cmsVersionFile); + $cmsVersion = file_get_contents(BASE_PATH . '/cms/silverstripe_version'); + $sapphireVersion = file_get_contents(BASE_PATH . '/sapphire/silverstripe_version'); + if(!$cmsVersion || !$sapphireVersion) return; - if($sapphireVersion == $cmsVersion) { + if($cmsVersion == $sapphireVersion) { return $sapphireVersion; - } else { - return "cms: $cmsVersion, sapphire: $sapphireVersion"; - } - } - - /** - * Return the version from the content of a silverstripe_version file - */ - public function versionFromVersionFile($fileContent) { - if(preg_match('/\/trunk\/silverstripe_version/', $fileContent)) { - return "trunk"; } else { - preg_match("/\/(?:branches|tags\/rc|tags\/beta|tags\/alpha|tags)\/([A-Za-z0-9._-]+)\/silverstripe_version/", $fileContent, $matches); - return ($matches) ? $matches[1] : null; + return sprintf("cms: %s, sapphire: %s", $cmsVersion, $sapphireVersion); } + } /** diff --git a/silverstripe_version b/silverstripe_version index 8c6cfe75..e69de29b 100644 --- a/silverstripe_version +++ b/silverstripe_version @@ -1 +0,0 @@ -$URL$ diff --git a/tests/LeftAndMainTest.php b/tests/LeftAndMainTest.php index 295cba3f..6835f7c1 100644 --- a/tests/LeftAndMainTest.php +++ b/tests/LeftAndMainTest.php @@ -14,25 +14,6 @@ class LeftAndMainTest extends FunctionalTest { CMSMenu::populate_menu(); } - /** - * Test that CMS versions can be interpreted appropriately - */ - public function testCMSVersion() { - $l = new LeftAndMain(); - $this->assertEquals("2.4", $l->versionFromVersionFile( - '$URL: http://svn.silverstripe.com/open/modules/cms/branches/2.4/silverstripe_version $')); - $this->assertEquals("2.2.0", $l->versionFromVersionFile( - '$URL: http://svn.silverstripe.com/open/modules/cms/tags/2.2.0/silverstripe_version $')); - $this->assertEquals("trunk", $l->versionFromVersionFile( - '$URL: http://svn.silverstripe.com/open/modules/cms/trunk/silverstripe_version $')); - $this->assertEquals("2.4.0-alpha1", $l->versionFromVersionFile( - '$URL: http://svn.silverstripe.com/open/modules/cms/tags/alpha/2.4.0-alpha1/silverstripe_version $')); - $this->assertEquals("2.4.0-beta1", $l->versionFromVersionFile( - '$URL: http://svn.silverstripe.com/open/modules/cms/tags/beta/2.4.0-beta1/silverstripe_version $')); - $this->assertEquals("2.4.0-rc1", $l->versionFromVersionFile( - '$URL: http://svn.silverstripe.com/open/modules/cms/tags/rc/2.4.0-rc1/silverstripe_version $')); - } - /** * Check that all subclasses of leftandmain can be accessed */ From 838ac9717719083d3718d804fe6c8c16355ef331 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Mon, 9 Jul 2012 13:24:00 +1200 Subject: [PATCH 09/14] BUGFIX: fixing an edge-case bug where a 404-page would get statically published and overwrite the homepage of the site (this would sometimes happen when a RedirectorPage was set to an external URL and still referenced an internal page ID) --- code/staticpublisher/FilesystemPublisher.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/staticpublisher/FilesystemPublisher.php b/code/staticpublisher/FilesystemPublisher.php index 68a17705..eb850cef 100644 --- a/code/staticpublisher/FilesystemPublisher.php +++ b/code/staticpublisher/FilesystemPublisher.php @@ -186,11 +186,12 @@ class FilesystemPublisher extends StaticPublisher { $response = Director::test(str_replace('+', ' ', $url)); Requirements::clear(); - - - + singleton('DataObject')->flushCache(); + //skip any responses with a 404 status code. We don't want to turn those into statically cached pages + if (!$response || $response->getStatusCode() == '404') continue; + // Generate file content // PHP file caching will generate a simple script from a template if($this->fileExtension == 'php') { From 06e184a97f361719d312dbf35dfc4d0ceea0e0d7 Mon Sep 17 00:00:00 2001 From: Naomi Guyer Date: Mon, 15 Oct 2012 14:59:04 +1300 Subject: [PATCH 10/14] BUG: Add "add new" button to Pages list view (fixes 7649) Rearranged the templates around CMSPagesController_ContentToolbar and uncommented the toolbar from the pages list view so the add new button would be included with including actions that aren't applicable to the gridfield. Linked to https://github.com/silverstripe/sapphire/pull/684/commits --- templates/Includes/CMSMain_ListView.ss | 2 +- templates/Includes/CMSMain_TreeView.ss | 1 + templates/Includes/CMSPagesController_ContentToolActions.ss | 3 --- templates/Includes/CMSPagesController_ContentToolbar.ss | 6 +++++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/Includes/CMSMain_ListView.ss b/templates/Includes/CMSMain_ListView.ss index 2ca34245..0cf247d2 100644 --- a/templates/Includes/CMSMain_ListView.ss +++ b/templates/Includes/CMSMain_ListView.ss @@ -1,5 +1,5 @@
- <%--<% include CMSPagesController_ContentToolActions %>--%> + <% include CMSPagesController_ContentToolActions %>
diff --git a/templates/Includes/CMSMain_TreeView.ss b/templates/Includes/CMSMain_TreeView.ss index 9c54d888..ae9f1d08 100644 --- a/templates/Includes/CMSMain_TreeView.ss +++ b/templates/Includes/CMSMain_TreeView.ss @@ -1,4 +1,5 @@
+ <% include CMSPagesController_ContentToolActions %> <% include CMSPagesController_ContentToolbar %>
diff --git a/templates/Includes/CMSPagesController_ContentToolActions.ss b/templates/Includes/CMSPagesController_ContentToolActions.ss index 62052846..b0298842 100644 --- a/templates/Includes/CMSPagesController_ContentToolActions.ss +++ b/templates/Includes/CMSPagesController_ContentToolActions.ss @@ -2,6 +2,3 @@ <% _t('CMSMain.AddNewButton', 'Add new') %>
-
- $BatchActionsForm -
\ No newline at end of file diff --git a/templates/Includes/CMSPagesController_ContentToolbar.ss b/templates/Includes/CMSPagesController_ContentToolbar.ss index 6717ce38..79118538 100644 --- a/templates/Includes/CMSPagesController_ContentToolbar.ss +++ b/templates/Includes/CMSPagesController_ContentToolbar.ss @@ -1,3 +1,7 @@ +
+ $BatchActionsForm +
+
<% _t("TreeTools.DisplayLabel","Display:") %> <% if CanOrganiseSitetree %> @@ -11,4 +15,4 @@
-<% include CMSPagesController_ContentToolActions %> + From 607fc58c8facfc0137abbbc7106c68c92b075447 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 16 Oct 2012 18:25:49 +0200 Subject: [PATCH 11/14] Build status in README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ad83f86..478fcb19 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -## Overview +## SilverStripe CMS + +[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-cms.png)](http://travis-ci.org/silverstripe/silverstripe-cms) PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`framework`](http://github.com/silverstripe/sapphire) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project. From c9244456e04e1eee06adff2d29700f962a2b9ce7 Mon Sep 17 00:00:00 2001 From: Naomi Guyer Date: Thu, 18 Oct 2012 14:47:11 +1300 Subject: [PATCH 12/14] BUG: Installation successful "CMS" link has broken href (fixes #7874) Fixed the template component of this bug. Language files will also need to be updated. eg. "Start editing" should appear in the en lang files as: StartEditing: 'You can start editing your site''s content by opening the CMS --- templates/Includes/Install_successfullyinstalled.ss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Includes/Install_successfullyinstalled.ss b/templates/Includes/Install_successfullyinstalled.ss index 44b01499..e7f9b5ce 100644 --- a/templates/Includes/Install_successfullyinstalled.ss +++ b/templates/Includes/Install_successfullyinstalled.ss @@ -10,7 +10,7 @@     <%t ContentController.Password "Password" %>: $Password

- <%t ContentController.StartEditing "You can start editing your site's content by opening the CMS." link="admin/" %> + <%t ContentController.StartEditing 'You can start editing your site\'s content by opening the CMS.' link="admin/" %>

From 72543440cb33e97279571c2cc1a054a6fd4a7531 Mon Sep 17 00:00:00 2001 From: Russell Michell Date: Fri, 19 Oct 2012 16:04:32 +1300 Subject: [PATCH 13/14] BUGFIX: Fixed SideReport for use with Postgres (using v8.4) which requires table/column-names to be quoted. MySQL seems OK with either/both --- code/reports/SideReport.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/reports/SideReport.php b/code/reports/SideReport.php index 241cee4b..3e119c65 100644 --- a/code/reports/SideReport.php +++ b/code/reports/SideReport.php @@ -200,8 +200,8 @@ class SideReport_BrokenLinks extends SS_Report { $classes = array_diff(ClassInfo::subclassesFor('SiteTree'), ClassInfo::subclassesFor('VirtualPage'), ClassInfo::subclassesFor('RedirectorPage')); $classNames = "'".join("','", $classes)."'"; - if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1"); - else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1"); + if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "\"ClassName\" IN ($classNames) AND \"HasBrokenLink\" = 1"); + else $ret = DataObject::get('SiteTree', "\"ClassName\" IN ($classNames) AND \"HasBrokenLink\" = 1"); return $ret; } public function columns() { @@ -238,8 +238,8 @@ class SideReport_BrokenFiles extends SS_Report { $classes = array_diff(ClassInfo::subclassesFor('SiteTree'), ClassInfo::subclassesFor('VirtualPage'), ClassInfo::subclassesFor('RedirectorPage')); $classNames = "'".join("','", $classes)."'"; - if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenFile = 1"); - else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenFile = 1"); + if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "\"ClassName\" IN ($classNames) AND \"HasBrokenFile\" = 1"); + else $ret = DataObject::get('SiteTree', "\"ClassName\" IN ($classNames) AND \"HasBrokenFile\" = 1"); return $ret; } public function columns() { @@ -271,8 +271,8 @@ class SideReport_BrokenVirtualPages extends SS_Report { } public function sourceRecords($params = null) { $classNames = "'".join("','", ClassInfo::subclassesFor('VirtualPage'))."'"; - if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1"); - else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1"); + if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "\"ClassName\" IN ($classNames) AND \"HasBrokenLink\" = 1"); + else $ret = DataObject::get('SiteTree', "\"ClassName\" IN ($classNames) AND \"HasBrokenLink\" = 1"); return $ret; } @@ -306,8 +306,8 @@ class SideReport_BrokenRedirectorPages extends SS_Report { public function sourceRecords($params = null) { $classNames = "'".join("','", ClassInfo::subclassesFor('RedirectorPage'))."'"; - if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1"); - else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1"); + if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "\"ClassName\" IN ($classNames) AND \"HasBrokenLink\" = 1"); + else $ret = DataObject::get('SiteTree', "\"ClassName\" IN ($classNames) AND \"HasBrokenLink\" = 1"); return $ret; } From b221f7ba7ae58c67e6cfe4cbbd6be7f45515ab1e Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Tue, 23 Oct 2012 19:32:25 +1300 Subject: [PATCH 14/14] FIX Remove Metadata Label from RedirectorPage. (Fixes #7959) --- code/model/RedirectorPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/model/RedirectorPage.php b/code/model/RedirectorPage.php index 6378bee0..a7ff2008 100644 --- a/code/model/RedirectorPage.php +++ b/code/model/RedirectorPage.php @@ -120,7 +120,7 @@ class RedirectorPage extends Page { $fields->removeByName('Content', true); // Remove all metadata fields, does not apply for redirector pages - $fields->removeByName('MetaTagsHeader'); + $fields->removeByName('Metadata'); $fields->removeByName('MetaTitle'); $fields->removeByName('MetaKeywords'); $fields->removeByName('MetaDescription');