diff --git a/core/manifest/ClassManifest.php b/core/manifest/ClassManifest.php index 789df88e3..f0645fa4f 100644 --- a/core/manifest/ClassManifest.php +++ b/core/manifest/ClassManifest.php @@ -61,16 +61,16 @@ class SS_ClassManifest { public static function get_namespaced_class_parser() { return new TokenisedRegularExpression(array( 0 => T_CLASS, - 1 => T_WHITESPACE, + 1 => array(T_WHITESPACE, 'optional' => true), 2 => array(T_STRING, 'can_jump_to' => array(8, 16), 'save_to' => 'className'), - 3 => T_WHITESPACE, + 3 => array(T_WHITESPACE, 'optional' => true), 4 => T_EXTENDS, - 5 => T_WHITESPACE, + 5 => array(T_WHITESPACE, 'optional' => true), 6 => array(T_NS_SEPARATOR, 'save_to' => 'extends[]', 'optional' => true), 7 => array(T_STRING, 'save_to' => 'extends[]', 'can_jump_to' => array(6, 16)), - 8 => T_WHITESPACE, + 8 => array(T_WHITESPACE, 'optional' => true), 9 => T_IMPLEMENTS, - 10 => T_WHITESPACE, + 10 => array(T_WHITESPACE, 'optional' => true), 11 => array(T_NS_SEPARATOR, 'save_to' => 'interfaces[]', 'optional' => true), 12 => array(T_STRING, 'can_jump_to' => array(11, 16), 'save_to' => 'interfaces[]'), 13 => array(T_WHITESPACE, 'optional' => true), @@ -87,7 +87,7 @@ class SS_ClassManifest { public static function get_namespace_parser() { return new TokenisedRegularExpression(array( 0 => T_NAMESPACE, - 1 => T_WHITESPACE, + 1 => array(T_WHITESPACE, 'optional' => true), 2 => array(T_NS_SEPARATOR, 'save_to' => 'namespaceName[]', 'optional' => true), 3 => array(T_STRING, 'save_to' => 'namespaceName[]', 'can_jump_to' => 2), 4 => array(T_WHITESPACE, 'optional' => true), @@ -101,7 +101,7 @@ class SS_ClassManifest { public static function get_interface_parser() { return new TokenisedRegularExpression(array( 0 => T_INTERFACE, - 1 => T_WHITESPACE, + 1 => array(T_WHITESPACE, 'optional' => true), 2 => array(T_STRING, 'save_to' => 'interfaceName') )); } @@ -119,7 +119,7 @@ class SS_ClassManifest { public static function get_imported_namespace_parser() { return new TokenisedRegularExpression(array( 0 => T_USE, - 1 => T_WHITESPACE, + 1 => array(T_WHITESPACE, 'optional' => true), 2 => array(T_NS_SEPARATOR, 'save_to' => 'importString[]', 'optional' => true), 3 => array(T_STRING, 'save_to' => 'importString[]', 'can_jump_to' => array(2, 8)), 4 => array(T_WHITESPACE, 'save_to' => 'importString[]'), diff --git a/core/manifest/TokenisedRegularExpression.php b/core/manifest/TokenisedRegularExpression.php index dca609c60..0979f1c40 100644 --- a/core/manifest/TokenisedRegularExpression.php +++ b/core/manifest/TokenisedRegularExpression.php @@ -110,6 +110,9 @@ class TokenisedRegularExpression { } else return true; } + else if (in_array($tokens[$tokenPos][0], array(T_COMMENT, T_DOC_COMMENT, T_WHITESPACE))) { + return $this->matchFrom($tokenPos + 1, $expressionPos, $tokens, $matches); + } return false; diff --git a/docs/en/04_Changelogs/3.4.5.md b/docs/en/04_Changelogs/3.4.5.md new file mode 100644 index 000000000..4aae74d30 --- /dev/null +++ b/docs/en/04_Changelogs/3.4.5.md @@ -0,0 +1,10 @@ +# 3.4.5 + + + +## Change Log + +### Bugfixes + + * 2017-02-08 [1f3d46b](https://github.com/silverstripe/silverstripe-framework/commit/1f3d46b832c4f69b7c9accd38476491e304a4877) #6606 the JS SiteTree lib depends on whitespace (Daniel Hensby) + * 2017-01-30 [10d9f90](https://github.com/silverstripe/silverstripe-cms/commit/10d9f9080b6cc6c909abdae796e8ce944036ccc2) to allow ASSETS_DIR to be a subdirectory (Brendan Halley) diff --git a/forms/gridfield/GridFieldExportButton.php b/forms/gridfield/GridFieldExportButton.php index d6eeb6610..30df9f01f 100644 --- a/forms/gridfield/GridFieldExportButton.php +++ b/forms/gridfield/GridFieldExportButton.php @@ -127,8 +127,13 @@ class GridFieldExportButton implements GridField_HTMLProvider, GridField_ActionP // determine the CSV headers. If a field is callable (e.g. anonymous function) then use the // source name as the header instead + foreach($csvColumns as $columnSource => $columnHeader) { - $headers[] = (!is_string($columnHeader) && is_callable($columnHeader)) ? $columnSource : $columnHeader; + if (is_array($columnHeader) && array_key_exists('title', $columnHeader)) { + $headers[] = $columnHeader['title']; + } else { + $headers[] = (!is_string($columnHeader) && is_callable($columnHeader)) ? $columnSource : $columnHeader; + } } $fileData .= "\"" . implode("\"{$separator}\"", array_values($headers)) . "\""; diff --git a/tests/core/manifest/ClassManifestTest.php b/tests/core/manifest/ClassManifestTest.php index 0a0e7ddc9..582b48e9f 100644 --- a/tests/core/manifest/ClassManifestTest.php +++ b/tests/core/manifest/ClassManifestTest.php @@ -41,6 +41,7 @@ class ClassManifestTest extends SapphireTest { 'classb' => "{$this->base}/module/classes/ClassB.php", 'classc' => "{$this->base}/module/classes/ClassC.php", 'classd' => "{$this->base}/module/classes/ClassD.php", + 'classe' => "{$this->base}/module/classes/ClassE.php", 'sstemplateparser' => FRAMEWORK_PATH."/view/SSTemplateParser.php", 'sstemplateparseexception' => FRAMEWORK_PATH."/view/SSTemplateParser.php" ); @@ -49,7 +50,7 @@ class ClassManifestTest extends SapphireTest { public function testGetClassNames() { $this->assertEquals( - array('sstemplateparser', 'sstemplateparseexception', 'classa', 'classb', 'classc', 'classd'), + array('sstemplateparser', 'sstemplateparseexception', 'classa', 'classb', 'classc', 'classd', 'classe'), $this->manifest->getClassNames()); } diff --git a/tests/core/manifest/fixtures/classmanifest/module/classes/ClassE.php b/tests/core/manifest/fixtures/classmanifest/module/classes/ClassE.php new file mode 100644 index 000000000..ff0fc934a --- /dev/null +++ b/tests/core/manifest/fixtures/classmanifest/module/classes/ClassE.php @@ -0,0 +1,8 @@ +