Commit Graph

2412 Commits

Author SHA1 Message Date
Will Rossiter
8b92300622 Add support for many_many_extraField in YAML
Format is

RelationName:
  - =>Obj.name:
    ExtraFieldName: "Foo"
2014-02-24 22:03:53 +13:00
Damian Mooyman
ebeb663ddf BUG Fixed critical issue with Folder::find_or_make failing to handle invalid filename characters
BUG Fix UploadField duplicate checking with invalid folderName
2014-02-21 09:11:34 +13:00
Ingo Schommer
705c75baa5 Merge pull request #2861 from srizzling/expand-filter-update
Expand CMS Panel Update + New Test File
2014-02-18 23:38:31 +13:00
Ingo Schommer
d8361f9d3f Merge remote-tracking branch 'origin/3.1' 2014-02-18 22:06:59 +13:00
Hamish Friedlander
d6630d240a NEW Allow specifying element whitelist in HTMLText fields 2014-02-18 14:02:04 +13:00
Sriram Venkatesh
80997171cc Updated Expand CMS Panel to find first visible panel and added new test file 2014-02-18 11:17:31 +13:00
Sean Harvey
30e3904e4c Merge pull request #2845 from kinglozzer/1429-summary-searchable-fields
FIX: searchable_fields inheritance from summary_fields includes methods called on fields (fixes #1429)
2014-02-17 15:14:54 +13:00
Sean Harvey
03f14565b5 Merge pull request #2841 from chillu/pulls/dateformat-simplified
API Default to "yyyy-MM-dd" for date format
2014-02-17 14:05:39 +13:00
Loz Calver
d91c7d14b8 FIX: Rewrite Member getCMSFields to ensure updateCMSFields is only run once (fixes #2827)
Fix usage of  inside closure

Can't use self:: in closure either

Basic unit tests to check extensions are applied correctly
2014-02-16 21:21:15 +00:00
Ingo Schommer
f63a78c0b9 Fixed Filesystem class capitalization 2014-02-17 00:12:26 +13:00
Ingo Schommer
6906c9bd1a API Removed auto-detection for i18n date/time formats
Default to "yyyy-MM-dd" for date format, and "H:mm" for time_format.
Switched to config API for setting/getting values.

Avoid using "MMM" in particular, since it causes
inconsistencies in month names between jQuery UI and Zend_Locale_Format.

Fixes https://github.com/silverstripe/silverstripe-cms/issues/544
2014-02-16 23:57:49 +13:00
Loz Calver
a91a4bbdc2 FIX: Searchable fields with dot notation can be inherited from summary_fields (fixes #1429) 2014-02-14 21:52:47 +00:00
Sam Minnee
a1c3cf1cf4 Removed use of assertCount() from this test as it causes infinite loops on Travis. 2014-02-14 16:39:36 +13:00
Sam Minnee
346d3edb37 Merge branch '3.1' 2014-02-13 17:58:30 +13:00
Sam Minnee
4f7c6ebcff FIX: Fixed behat text selection rule, which broke some tests.
The behat rule for text selection wasn't working due to the JavaScript not executing properly. I have
also updated the code to traverse all childNodes, which is important if you have text like this:

<p>text1 <b>text2</b> text3</p>

And you are trying to select 'text3'
2014-02-13 17:36:46 +13:00
Sean Harvey
9048eab4a2 Merge branch '3.1' 2014-02-12 11:06:54 +13:00
Ingo Schommer
5e38ef9e55 Merge pull request #2835 from kinglozzer/1891-csrf-friendly-error
NEW: Forms with invalid/expired SecurityIDs are repopulated (fixes #1891)
2014-02-12 09:44:03 +13:00
Sean Harvey
c322cb2d65 Fixing SQLQueryTest failures on PHPUnit 3.7.30 2014-02-10 13:32:39 +13:00
Loz Calver
058219c0ee NEW: Forms with invalid/expired SecurityIDs are repopulated (fixes #1891) 2014-02-09 10:19:24 +00:00
Ingo Schommer
4af9143d3b Merge remote-tracking branch 'origin/3.1'
Conflicts:
	docs/en/misc/contributing/code.md
2014-02-07 16:43:22 +13:00
madmatt
267786a7d1 Add behat test for security permission checkboxes. 2014-02-07 15:41:33 +13:00
Mateusz Uzdowski
e91f10b0ab Add Behat step to click on a row in the first GridField table. 2014-02-07 15:40:06 +13:00
Ingo Schommer
bb9f84afd5 Merge pull request #2806 from tractorcow/pulls/bug-member-locale
BUG Default Member.Locale now chooses a better default value when i18n.locale is not a valid translation
2014-02-03 17:03:48 -08:00
Ingo Schommer
457ec9446b Merge pull request #2700 from ajshort/injector-factory
Injector Factory
2014-02-03 16:50:15 -08:00
Damian Mooyman
cd213ab488 BUG Fixed handing of false values in GridState_Data
API Added ability to unset values
2014-02-04 10:26:26 +13:00
Daniel Hensby
6df276c843 BUG GridState_Data doesn't hold falsey values
After patch #2522 was taken GridField_Data was no longer able to hold
falsey values. See failing tests.
2014-02-04 10:26:18 +13:00
Ingo Schommer
0d7e9a9692 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	_config/routes.yml
	docs/en/topics/datamodel.md
	forms/DropdownField.php
2014-02-04 08:19:04 +13:00
Andrew Short
2f817ba177 NEW: Allow specifying a factory to use for creating services.
A service factory can be used for creating instances where a non-trivial
construction process is required. This is done by adding a `factory`
key to the service definition.
2014-02-03 11:30:22 +11:00
Ingo Schommer
91b363b141 Merge pull request #2756 from madmatt/pulls/behat-form-context
Update theHtmlFieldShouldContain step to include negation.
2014-01-30 18:09:55 -08:00
Ingo Schommer
558d202bf2 Merge pull request #2746 from micmania1/move-test-theme-setup
API moved useTestTheme to base Sapphire test class so that it can be used elsewhere
2014-01-30 18:08:21 -08:00
Kirk Mayo
44a8537f68 BUG: #2503 Fixes performReadonlyTransformation for OptionSetField
NEW: Adding unit test for performReadonlyTransformation #nd fixing OptionSetField #2503

BUG: Fixing undefined variables and function parameters for PerformReadonlyTransformation unit tests

NEW: Adding unit test to OptionsetField for read only fields
2014-01-30 16:09:55 +13:00
Damian Mooyman
293c672fa7 BUG Default Member.Locale now chooses a better default value when i18n.locale is not a valid translation
This will resolve issues in cases where the site locale may be assigned a value that does not have an explicit translation. E.g. if the locale is en_NZ (and it's appropriate for this to be the assigned locale), Afrikaans will no longer be the default selected locale when creating members. Now en_US is chosen as a better fallback default.

This is a minor ease of use fix that means fewer CMS users can be accidentally created in Afrikaans within NZ based sites.

Test cases included.
2014-01-30 15:55:14 +13:00
Simon Welsh
cf01ca818a Revert "MINOR: Added behat test to cover changes made in e69e65c."
This reverts commit e0b4e6125c.
2014-01-22 15:20:48 +13:00
Mateusz U
ce3a944903 Merge pull request #2780 from madmatt/pulls/securityadmin-js2
BUGFIX: Fix JS for PermissionCheckboxsetField in SecurityAdmin
2014-01-20 19:00:00 -08:00
madmatt
e0b4e6125c MINOR: Added behat test to cover changes made in e69e65c. 2014-01-15 16:20:19 +13:00
Ryan Wachtl
5f87d344f1 FIX Overriding of theme templates in project folder
Fixes issue of templates not being found when a Page's main/Layout templates are split between the project and theme folders. Adds more expansive testing for template loading.
2014-01-14 15:05:24 -06:00
Will Rossiter
a50996a010 NEW: Add support for push operator on ArrayList (Fixes #1539) 2014-01-12 18:55:40 +13:00
Will Rossiter
e7266535c5 FIX: Allow empty checkboxes through setValue(null) (#1392) 2014-01-12 17:28:09 +13:00
Will Rossiter
4ea62b44f9 FIX: Ensure GridFieldDetailForm has the current record validator.
Currently the validator is only set through
ModelAdmin and not through GridField
directly. This will set the validator based on the
record unless a custom validator has been
provided.

http://www.silverstripe.org/data-model-questions/show/34650?start=8#post331958
2014-01-12 16:08:31 +13:00
Will Rossiter
f433b5000f FIX: Resolve issue when selected value is zero. (#2530)
$this->value is stored as string internally. In
the special case that the option value is 0, the
type comparison fails to resolve 0 == '0',
see http://www.php.net/manual/en/types.comparisons.php.
2014-01-11 13:25:40 +13:00
Jeremy Shipman
62694b0a8b NEW: Made ValidationResult functions chain-able.
Added unit tests for CombiningResults
2014-01-09 16:32:27 +13:00
Simon Welsh
39d42e4ea3 Merge branch '3.1' 2014-01-09 08:22:47 +13:00
Jeremy Shipman
8d8f3abace FIX: ConfirmedPasswordField setName failed to set names of child fields.
FIX: ConfirmedPasswordField relied on POST variables. These should instead come from setValue().
Added all important tests for validating the field: valid if passwords match, invalid if passwords differ.
2014-01-07 17:17:55 +13:00
Matt Peel
0eaae90bdb Update theHtmlFieldShouldContain step to include negation.
This allows steps to be declared as either “should contain” or “should not
contain”.
2014-01-06 17:22:40 +13:00
madmatt
2b00036d9d Allow GridFields without titles to be found. 2014-01-06 10:20:44 +13:00
micmania1
5fff5afb47 API moved useTestTheme to base Sapphire test class so that it can be used elsewhere (eg CMS test) 2013-12-23 21:54:20 +00:00
Stephen Shkardoon
40163edba7 Make CacheTest sleep properly
This way it will always sleep for the right amount of time (or longer)
2013-12-21 15:05:51 +13:00
Will Rossiter
3d2875a111 Merge pull request #2741 from simonwelsh/hhvm-test
Changes to error message detection to handle the differences in HHVM
2013-12-20 16:55:14 -08:00
Simon Welsh
8de403abd4 Changes to error message detection to handle the differences in HHVM 2013-12-21 13:17:47 +13:00
micmania1
229bea399b added logout url to Security and deprecated Security::set_login_url in favour of config 2013-12-20 21:55:54 +00:00
Ingo Schommer
60333f68ee NEW UploadField lists all files, shows path info
It doesn't make a lot of sense to limit the listing
to assets/Uploads/, which is the default set through FileField->folderName.
Showing all files regardless of folder makes them easier
to find, users can still opt-in to filtering by folder
through the TreeDropdownField.
2013-12-20 01:00:36 +01:00
madmatt
7d271d5346 Fix profile.feature behat test 2013-12-20 12:32:44 +13:00
Ingo Schommer
1afb8bb414 Merge remote-tracking branch 'origin/3.1' 2013-12-19 20:47:31 +01:00
Ingo Schommer
d032fadfb5 Fixed spelling of class in test 2013-12-19 20:47:16 +01:00
Ingo Schommer
f29d51f433 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	docs/en/reference/dataobject.md
	lang/es.yml
2013-12-19 20:23:09 +01:00
Ingo Schommer
78a530524b Merge pull request #2684 from Firesphere/feature/force_write_js_to_bottom
NEW Forcefully write javascripts to the end of the HTML if wished
2013-12-19 09:21:06 -08:00
Sean Harvey
6fc9db6f0e API DataObject::validate() visibility changed to public (issue #1659)
DataObject::validate() is currently set to protected, but this means
you can't call validate() from outside the context of itself unless
you overload the method to use a public visibility and then call
parent::validate()

As it would turn out, most classes that overload this method already
set the visibility to public, so it would make sense the parent matches
that as well.
2013-12-19 16:36:39 +13:00
Daniel Pickering
94c19e349a FIX: Year.php getDefaultOptions now fixed, sets key as year. Also added YearTest unit test. 2013-12-16 03:29:29 +00:00
Firesphere
af7afbe918 IMPROVEMENT/FEATURE Forcefully write javascripts to the end of the HTML if wanted.
It's defaulted to false. But when set to true, the JS is written to the end of the HTML, even though there are earlier scripts.
This results in faster page-loading if the JS isn't needed earlier-on.
2013-12-14 14:04:03 +01:00
Ingo Schommer
ab91a5a80b Merge pull request #2622 from froog/patch-1
Created LessThanOrEqualFilter and GreaterThanEqualFilter
2013-12-13 03:34:45 -08:00
Ingo Schommer
c811556ea5 Removed debug code 2013-12-13 10:04:26 +01:00
Firesphere
41371fea72 NEW Force the javascripts to be put before the closing body tag 2013-12-07 15:47:31 +01:00
Fred Condo
b88a0955a5 API: Support string descriptors for unique indexes in Versioned
- Document the format for descriptor arrays
- Implement the behaviour that developers have come to expect for
  string descriptors of indexes
- Add test for handling of unique indexes (MySQL & sqlite3)
- Resolve #2403

Versioned needs to convert unique indexes to non-unique for its suffixed
tables, such as Foo_Live and Foo_versions. Because DataObject accepts
string descriptors such as array('UniqIDX' => 'unique (Uniq)') as well
as array-based descriptors, Versioned needs to recognize string
descriptors. This patch accomplishes that. Before, Versioned would fail
to convert string-described indexes to non-unique, resulting in run-time
errors when creating a new version of an object.
2013-12-06 10:02:44 -08:00
Ingo Schommer
740560c487 Fixed merge errors
- HTML identifier changes in master breaking tests
- Regression from b6b3cd9889 in GridFieldSortableHeader (var capitalisation)
2013-12-06 15:37:51 +01:00
Ingo Schommer
6176d65bd2 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	forms/gridfield/GridFieldSortableHeader.php
	model/DataList.php
	model/fieldtypes/Enum.php
2013-12-02 20:49:34 +01:00
Ingo Schommer
a7ad85c2a8 Better "editable page" Behat assertion 2013-12-02 19:07:14 +01:00
micmania1
b89ab1eb16 Added SSViewer::get_templates_by_class() to make the functionality in LeftAndMain::getTemplatesWithSuffix() more open. 2013-12-01 07:42:37 +00:00
Ingo Schommer
df2d59df1c Use more solid getValue() in Behat assertions
getAttribute('value') behaves inconsistently with Selenium drivers
(fails on Travis and TeamCity, but works locally). Selenium2Driver
in Mink provides a JS wrapper for getting the value, which is more reliable.

This fixes "insert a link" failures, see https://travis-ci.org/silverstripe/silverstripe-cms/jobs/14281251
2013-11-30 13:27:20 +01:00
Ingo Schommer
73eae2990f Merge pull request #2683 from tractorcow/pulls/2682-fix-gridfieldsortableheader
BUG Fixes #2682 - Regression in #2595
2013-11-29 09:17:39 -08:00
Sean Harvey
3a8833ec28 Fixing broken manage-users behat test.
"ADMIN group" is created by default, but assertions are checking
for "Admin Group".
2013-11-29 14:51:46 +13:00
Sean Harvey
cfc009964c Fixing undefined step caused by change in behat-extensio module. 2013-11-29 14:17:04 +13:00
Sean Harvey
761cc63e19 Adding test for CheckboxSetField saving into a text DB field. 2013-11-29 11:38:07 +13:00
Damian Mooyman
7636699c9f BUG Fixes #2682 - Regression in #2595 causing gridfield headers to break on summary_fields containing field methods 2013-11-27 18:43:27 +13:00
froog
755857b22a NEW: Created LessThanOrEqualFilter and GreaterThanEqualFilter 2013-11-25 03:59:51 +00:00
Ingo Schommer
784c766ee6 Revert "Don't rely on Behat/Selenium returning 'value' for textarea"
This reverts commit 8245125349.
2013-11-22 20:38:56 +01:00
Ingo Schommer
7e291133a0 Merge pull request #2663 from ajshort/has-many-prepopulate
NEW: Pre-populate and disable foreign key field on has many lists.
2013-11-22 11:18:11 -08:00
Ingo Schommer
053258b984 Merge pull request #2595 from kinglozzer/gridfield-sort-relation
NEW: GridField can sort on relation columns
2013-11-22 11:14:12 -08:00
Ingo Schommer
8245125349 Don't rely on Behat/Selenium returning 'value' for textarea
Technically a textarea DOM node doesn't have a 'value' attribute,
but rather a HTML content. This used to work, but likely broke either
by updated browser handling or updated selenium logic.
Fixes "Scenario: I can edit title and content and see the changes on draft"
2013-11-22 20:05:17 +01:00
Ingo Schommer
70207b0c98 Merge pull request #2626 from Zauberfisch/filterByCallback
filterByCallback added to SS_Filterable interface and implemented in ArrayList
2013-11-21 05:34:36 -08:00
Zauberfisch
d9b74874fc added filterByCallback() to interface SS_Filterable and all implementing classes 2013-11-21 13:03:18 +00:00
Will Rossiter
0e89c4b6cd API: Implement SS_Map::push() to append values.
FIX: SS_Map::count() not taking into account additional firstItems
2013-11-18 20:38:57 +13:00
Ingo Schommer
bd5fdf1f19 Fixing coding conventions in Behat files 2013-11-15 12:03:43 +01:00
Loz Calver
a1a402224f NEW: GridField can sort on relation columns
Slightly improved logic

Add support for relations more than one 'level' apart

Add unit tests

Fixing PostgreSQL support

Throw exception if attempting to sort on a has_many/many_many relation
2013-11-13 10:33:00 +00:00
Andrew Short
fc773c5c22 NEW: Pre-populate and disable foreign key field on has many lists.
This is a common use case, and by default a form field is added which
has no effect. While this coupling is undesirable, it makes the default
behaviour much more sensible.

See #2662, #2651, #2637 for more information.
2013-11-13 16:21:18 +11:00
Andrew Short
bedf292612 Merge branch '3.1'
Conflicts:
	docs/en/reference/execution-pipeline.md
	lang/nl.yml
2013-11-11 18:18:25 +11:00
Cam Spiers
14486902fb Allow users to extend the SSTemplateParser by defining open & closed blocks
Currently the only way the extend SSTemplateParser is to define a class
extension of it and then tell the injector component to use your new
custom class. This new change allows a user to define new "open blocks"
and "closed blocks" for SSTemplateParser to use without needing to
recompile the real SSTemplateParser class.

The following example shows how the functionality can be used
to add a new <% minify %>…<% end_minify %> syntax to the template parser

In a config.yml file, define the new minify closed block to call the
static function "Minifier::minify"

```
Injector:
	SSTemplateParser:
		properties:
			closedBlocks:
				minify: "Minifier::minify"
```

Define a new class with the minify static method that returns the new
template code when regenerating templates:

```
class Minifier {
    public static function minify(&$res) {
        return <<<PHP
{$res['Template']['php']}
\$val = zz\Html\HTMLMinify::minify(\$val, array('optimizationLevel' => zz\Html\HTMLMinify::OPTIMIZATION_ADVANCED));
PHP;
    }
}
```
2013-11-04 14:24:58 +13:00
Sean Harvey
70c23f37de Merge pull request #2608 from andrewvt/3.1
added removeFromGroupByCode() function to Member.php
2013-11-03 12:27:10 -08:00
andrewvt
389bdb4ddf Added a unit test for removeFromGroupByCode()
Added a unit test for removeFromGroupByCode()
2013-10-31 22:05:13 -04:00
Damian Mooyman
c74f7e7640 BUG Fixes issue where items could be deleted from a has_many relation by an entirely unrelated HasManyList calling delete on that item. 2013-11-01 11:39:13 +13:00
Will Rossiter
a0b7bfc7a5 Merge pull request #2604 from chillu/pulls/versioned-single-stage
Fixed support for single stage in Versioned
2013-10-29 01:40:40 -07:00
Ingo Schommer
dfabd54bdb Fixed support for single stage in Versioned
This used to work in 2.4, so is considered a regression.
To test, simply add a Versioned("Stage") extension to
some record in 2.4 vs. 3.1.
2013-10-24 17:09:17 +02:00
Ingo Schommer
7cf8e65309 Merge pull request #2598 from halkyon/test_execution_error
i18nSSLegacyAdapterTest setting wrong arguments for manifest.
2013-10-24 04:24:19 -07:00
Sean Harvey
e3542fead3 i18nSSLegacyAdapterTest setting wrong arguments for manifest.
Currently if you run i18nSSLegacyAdapterTest twice in a row you
get errors about classes not existing, because the class manifest
doesn't get set correctly during the test setUp() method.
2013-10-24 17:22:16 +13:00
Damian Mooyman
b6b3cd9889 API GridState_Data values can have default values specified during retrieval.
Fixes issues with GridStata_Data being returned from various states when value types are necessary.
Pruning of dead code from GridFieldAddExistingAutocompleter
Documentation for GridState
2013-10-24 16:15:33 +13:00
Ingo Schommer
628b920ea7 Fixed merge error in MemberTest 2013-10-23 18:26:05 +02:00
Ingo Schommer
b56ca812dc Merge remote-tracking branch 'origin/3.1'
Conflicts:
	tests/security/MemberTest.php
2013-10-23 14:53:29 +02:00
Ingo Schommer
d7e10e620a Merge pull request #2537 from wilr/membervalidator
FIX: Use Injector API for managing Member_Validator instance.
2013-10-23 03:01:15 -07:00
Ingo Schommer
6f41b6fae6 Merge pull request #2566 from NicoHaase/master
BUG: An enum field in the search panel model admin misses an option to not filter on that field
2013-10-22 06:43:36 -07:00
Nico Haase
ab10c2ecdc BUG: An enum field in the search panel model admin misses an option to not filter on that field 2013-10-22 15:39:37 +02:00
Ingo Schommer
39efaca54f Disable "lost password" feature, breaks on "php -S"
PHP's built-in webserver doesn't reliably expose SCRIPT_NAME,
see https://github.com/silverstripe/silverstripe-framework/issues/2580.
This breaks URL routing on /Security/passwordsent/admin%40test.com
2013-10-22 15:26:20 +02:00