Commit Graph

2345 Commits

Author SHA1 Message Date
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
Ingo Schommer
f2d362b629 Merge pull request #2576 from halkyon/fulltextsearch_test
FulltextSearchableTest doesn't clean up after itself.
2013-10-22 01:56:29 -07:00
Sean Harvey
acaf0e40cc FulltextSearchableTest doesn't clean up after itself.
The extension doesn't get unloaded correctly at the end of the test,
resulting in tests afterwards sometimes failing because the table
type is reset back to InnoDB.

See silverstripe/silverstripe-cms ed8ee4e9b for a similar fix done
in the cms module.
2013-10-22 17:52:51 +13:00
mandrew
56d7c1fde2 Behat tests for lost password 2013-10-22 00:06:36 +02:00
Ingo Schommer
5c1a9d9da5 Using Behat EmailContext by default 2013-10-21 00:50:29 +02:00
Ingo Schommer
d75f545887 Clear DB caches in SecurityTest 2013-10-20 14:23:23 +02:00
Ingo Schommer
25b6175e67 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	forms/FormField.php
2013-10-20 13:52:56 +02:00
Ingo Schommer
36e7282f6f Merge pull request #2561 from TomSpeak/patch-3
BUG FailedLoginCount reset
2013-10-18 07:20:48 -07:00
Thomas Speak
d22ca62c6f BUG FailedLoginCount reset
If you fail your maximum login attempts and are locked out, further failed login attempts add to your already existing FailedLoginCount as it is only reset if you log in successfully. This means that if you're locked out, then try again, one failure will automatically lock you out again, regardless of what you set your max limit to.

Example:

lock_out_after_incorrect_logins: 3
FailedLoginCount: 0

The user fails three login attempts.

lock_out_after_incorrect_logins: 3
FailedLoginCount: 3

The user is now locked out.

Lockout time passes.

The user fails their 4th login.

lock_out_after_incorrect_logins: 3
FailedLoginCount: 4

This will continue to happen until the user successfully logs in, without giving them the pre-defined amount of login attempts again due to this condition being met after every incorrect login:
```php
if($this->FailedLoginCount >= self::config()->lock_out_after_incorrect_logins) {
```

FailedLoginTestCount Test Added
2013-10-18 13:48:11 +01:00
Che Van Lawrence
2be25e70ba Merge pull request #2545 from hafriedlander/fix/protocol_and_oembed
FIX oembed to avoid mixed media issues
2013-10-17 19:09:35 -07:00
Nathan J. Brauer
fee54c75f0 API: Change DropdownField::getSource() to not return the emptyString value. 2013-10-18 11:16:27 +13:00
Will Rossiter
1c983bc16d API: LookupField::Field now returns an HTMLText instance.
Moved LookupField into a template, removed getSource() as the DropdownField getSource() has been simplified to just a getter
2013-10-18 10:28:17 +13:00
Hamish Friedlander
8801a50704 FIX oembed to avoid mixed media issues 2013-10-17 17:06:40 +13:00
Damian Mooyman
24950692cd BUG Fixes serious issue with FieldList::addFieldsToTab failing to accept multiple field groups.
Additional groups beyond the first are ignored.
Test cases included.
2013-10-17 15:38:22 +13:00
Will Rossiter
813d34b15e FIX: Use Injector API for managing Member_Validator instance.
Updates the CMS profile page and SecurityAdmin to give developers a few ways to customise the required fields.

Added extension hook updateValidator for getValidator for things like modules to inject required fields to go along with Injector for replacing the entire class for project specific use.
2013-10-16 11:29:43 +13:00
Marcus Nyeholt
7bcb180f27 BUG Director::test now calls RequestProcessor
This fixes https://github.com/silverstripe/silverstripe-framework/issues/2517
and provides some testing around the use of RequestProcessor in general.
2013-10-15 07:53:34 +11:00
Devlin
1e5679f20f BUGFIX i18n module load order in i18n::include_by_locale()
The "project" module (normally mysite) is considered with the highest priority. Yet, the project's i18n is loaded first and cannot overwrite existing translations. I've added a array_reverse(), so the iteration keeps the translation of the module with the highest priority.

Old $sortedModules: mysite, (other_modules,) cms, admin, framework.
New $sortedModules: framework, admin, cms, (other_modules,) mysite.
2013-10-11 15:20:51 +02:00
Ingo Schommer
8727d1b1eb Merge remote-tracking branch 'origin/3.1' 2013-10-10 12:11:50 +02:00
Loz Calver
51be1e858a Unit tests for Email
It's not much, but it's a start
2013-10-09 11:51:29 +01:00
Andrew Short
a339687493 API: Pass extra context information to shortcode handlers.
This allows shortcodes to perform more complex actions on the element
which contains them. For example, the element reference can be used
to add extra classes or attributes to links which provide additional
metadata.
2013-10-09 15:05:17 +11:00
Ingo Schommer
62fa2739e6 Merge remote-tracking branch 'origin/3.1' 2013-10-08 11:22:04 +02:00
Ingo Schommer
e489384eea Moved manage-files.feature to cms module 2013-10-08 11:21:36 +02:00
Ingo Schommer
d485faf0c9 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	forms/Form.php
2013-10-08 11:17:06 +02:00
Ingo Schommer
8d5209aef6 Migrated page-specific behat features to cms module 2013-10-08 00:24:05 +02:00
Ingo Schommer
6a665b4ca2 Behat jQuery reference 2013-10-07 23:44:13 +02:00
Ingo Schommer
6e8ec778c3 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	admin/templates/Includes/LeftAndMain_Menu.ss
	lang/en.yml
2013-10-07 16:19:40 +02:00
Ingo Schommer
795d3e4b3b Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	dev/install/install.php5
	docs/en/index.md
	tests/core/CoreTest.php
2013-10-07 16:18:20 +02:00
Ingo Schommer
7f0e589bf5 Behat test for language switching 2013-10-07 00:04:50 +02:00
Ingo Schommer
60fc7e5346 Merge remote-tracking branch 'origin/3.1' 2013-10-06 19:07:39 +02:00
Damian Mooyman
f67b549b77 BUG Fixed cross-platform issues with test cases and file utilities 2013-10-04 13:54:33 +13:00
Sean Harvey
38e4070ff7 Merge pull request #2477 from tractorcow/pulls/3.1-sqlquery-sort-order
BUG Sort column order maintained correctly when using expressions
2013-10-03 14:27:38 -07:00
Damian Mooyman
4b850fb41c BUG Fixed cross-platform issues with test cases and file utilities 2013-10-03 14:49:18 +13:00
Damian Mooyman
afaf7f6b4e BUG Sort column order maintained correctly when using expressions in SQLQuery and DataQuery 2013-10-03 14:20:31 +13:00
Ingo Schommer
a534b7c784 Merge remote-tracking branch 'origin/3.0' into 3.1 2013-10-02 12:21:35 +02:00
Ingo Schommer
06b5f142b6 Increased CacheTest time delay, avoid flickering tests
Setting a cache lifetime of half a second seems to be
unreliable on Travis when just waiting a second,
so let's wait a bit longer.
2013-10-02 12:13:22 +02:00
Andrew Short
c26c9e641a Fix test relying on specific member title format.
If a custom member title format was used, the test would fail as it
only expected the default member title format.
2013-10-02 15:16:33 +10:00
Damian Mooyman
fb5bb646fe BUG Fixed cross-platform issues with test cases and file utilities 2013-10-02 17:31:06 +13:00
Ingo Schommer
21c226a5d2 Merge remote-tracking branch 'origin/3.0' into 3.1 2013-09-30 23:44:12 +02:00
Ingo Schommer
a68e0ba365 Check for jQuery in Behat tests
Identified as one potential cause for flickering tests
on our own Selenium box.
2013-09-30 23:36:46 +02:00
Ingo Schommer
c7f656cd00 API Removed "PastMember" cookie and template getter
The functionality is easy to replicate in custom controllers,
and is too rarely used to be placed in core.

This also removes the `Member::is_repeat_member()` getter
and the `PastMember`/`IsRepeatMember` template globals.

See https://groups.google.com/forum/#!topic/silverstripe-dev/b8K3wU64TXg
2013-09-27 20:06:25 +02:00
Daniel Hensby
6c943007a1 removeRequiredField() limits field (fixes #2165)
Added tests to RequiredFields and fixed bugs that were found

Now you:
1. Can't add the same field name many times
2. Can use append RequiredFields correctly without fear of duplicates

I've also added a Deprecation warning to $useLabels as it's not used
*anywhere* in framework
2013-09-27 19:58:59 +02:00
Ingo Schommer
455e550d9a Merge remote-tracking branch 'origin/3.1'
Conflicts:
	docs/en/topics/testing/create-silverstripe-test.md
	forms/Form.php
	i18n/i18n.php
	model/Image.php
2013-09-27 19:22:14 +02:00
Ingo Schommer
48021e9fd3 Merge pull request #2166 from dhensby/patch-2
FormFields now allow setting of extra CSSClasses en masse
2013-09-24 11:50:01 -07:00
Ingo Schommer
5b3f8bc04d Merge pull request #2435 from hafriedlander/fix/join_links_query_params
FIX Use last of duplicate query params in join_links
2013-09-20 02:27:49 -07:00
Hamish Friedlander
b1f03db4ff FIX Improve recent RestfulService fix for proxies 2013-09-20 16:26:39 +12:00
Mateusz Uzdowski
7ddd5b57c3 BUG Do not rely on broken curl header size calculation.
Header parsing now takes into account situations like a proxy or
redirections. Works around the curl issue.

Also fixes the issue when a redirected request would cause a double
amount of headers coming out of the parser - it would merrily process
anything that's in key:value format even if it was two distinct headers.
2013-09-20 15:02:40 +12:00
Hamish Friedlander
a8c1dd7f53 FIX Use last of duplicate query params in join_links
When using Controller::join_links to join two links with identical query
params, both query params would be used in the result, ending up with
links that look like `../edit/show/14?locale=en_NZ&locale=mi_NZ`

This patch eliminates duplicate query params, so only the last one
for any key is present in the output.
2013-09-20 11:33:03 +12:00
Ingo Schommer
ba5984e2bf Only compare array notations in SQLQuery->getOrderedJoins()
If more than two $from were added through SQLQuery->addFrom(),
the getOrderedJoins() comparison kicks in. It assumes all $from
parts are in array notation, which isn't always the case.
For legacy reasons, and because we don't have full API support,
you can still add literal joins through addFrom('INNER JOIN ...').
On PHP 5.3, the ordering comparison still works because it
allows array access in strings, with string rather than numeric indexes.
Thankfully that's no longer supported in PHP 5.4.
2013-09-17 22:08:48 +02:00
Ingo Schommer
a87000170a Behat: "apply formatting" steps 2013-09-15 01:50:10 +02:00
Ingo Schommer
849f2c1cb1 Behat: "insert external link" feature 2013-09-14 19:50:22 +02:00
Ingo Schommer
d68a016026 Behat: Friendler field reference 2013-09-14 19:50:21 +02:00
Ingo Schommer
2fbe0c39f2 Behat: Correctly quote selector in dropdown step 2013-09-14 19:50:21 +02:00
Ingo Schommer
c9047a386f Behat: "insert link" feature 2013-09-14 19:50:21 +02:00
Ingo Schommer
7a4a1bbadb Behat: More "insert image" steps
Still needs definitions
2013-09-14 19:50:21 +02:00
Ingo Schommer
e202d4b3b0 Behat: Avoid false positives in dropdown traversal
Was identifying fields like <input value="Select a page">
when querying for a drop down labelled "Page"
2013-09-14 19:50:21 +02:00
Ingo Schommer
8de227554e Behat: More verbose error message in HTML field assertion 2013-09-14 19:50:21 +02:00
Ingo Schommer
fde6b65769 Behat: Allow quoted HTML in assertion 2013-09-14 19:50:21 +02:00
Ingo Schommer
35a32d608d More specific behat tree assertion 2013-09-14 19:50:21 +02:00
Ingo Schommer
5a0b4b0f03 Shorter behat feature name
Looks better in relishapp ;)
2013-09-13 18:52:02 +02:00
Ingo Schommer
819eebb5dc Behat: Profile feature (steps only) 2013-09-13 18:44:17 +02:00
Ingo Schommer
aa80c4eed2 Behat feature indentation (no content changes) 2013-09-13 18:42:27 +02:00
lukepercy
e6f7f637f3 Added feature file for behat test
- Added content formatting behat feature file Updated Given statement for Insert link behat feature file
- Added Behat test feature file for alignment buttons Updated formatting buttons feature file to include strikethrough formatting
2013-09-13 17:00:43 +02:00
Sean Harvey
17fb7752db Skipping SQLQueryTest::testZeroLimitWithOffset() for MSSQLDatabase.
This test doesn't work on MSSQLDatabase.
2013-09-13 15:50:36 +12:00
Sean Harvey
bf1110d911 Adding a test for SQLQuery::setLimit() parsing OFFSET string clause. 2013-09-13 15:44:46 +12:00
Russell Michell
bbda63a16f MINOR: Corrected tests to use assertFalse|True() 2013-09-13 12:27:37 +12:00
Russell Michell
3aaa12f114 FIX: Fixes #2398
- hasAmount() failed to return true for values <= 0.99 and >= 0.01
- Added unit tests
2013-09-13 12:21:21 +12:00
Ingo Schommer
c2b312d76f Merge remote-tracking branch 'origin/3.1.0' into 3.1 2013-09-12 17:24:42 +02:00
Ingo Schommer
05757efceb FIX Privilege escalation through APPLY_ROLES assignment (SS-2013-005)
See http://www.silverstripe.org/ss-2013-005-privilege-escalation-through-apply-roles-assignment/
2013-09-12 15:42:43 +02:00