Commit Graph

654 Commits

Author SHA1 Message Date
Ingo Schommer
b56ca812dc Merge remote-tracking branch 'origin/3.1'
Conflicts:
	tests/security/MemberTest.php
2013-10-23 14:53:29 +02:00
colymba
46272ffb93 image cacheFilename checks for numeric strings
using JSON_NUMERIC_CHECK json_encode flag and avoid duplicate files
creation
2013-10-23 10:16:18 +03:00
Andrew Short
156bb87d57 FIX: Move stage choosing into a pre-request filter.
This ensures that the correct stage is selected, even if the request
does not come through the model as controller system. This fixes an
issue where custom controllers would always be on the "Stage" stage.
2013-10-23 18:29:13 +13: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
25b6175e67 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	forms/FormField.php
2013-10-20 13:52:56 +02:00
Damian Mooyman
52f6581ecf API Better declaration of DataObject field change levels.
Use of const named identifiers to represent each change level rather than numbers.
2013-10-17 12:55:58 +13:00
Ingo Schommer
1bcd4c9a6a Merge pull request #2531 from ajshort/pull-5
Correct some incorrect PHPDoc definitions.
2013-10-13 01:36:16 -07:00
Andrew Short
c082dc3bd1 Correct some incorrect PHPDoc definitions. 2013-10-13 18:59:53 +11: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
60fc7e5346 Merge remote-tracking branch 'origin/3.1' 2013-10-06 19:07:39 +02:00
Sean Harvey
8b2e1f2e7c Merge pull request #2328 from chillu/pulls/versioned-archivemode-validation
Validate 'archiveDate' user data in Versioned
2013-10-03 14:33:22 -07: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
f18ece11ca Revert "Fixes silverstripe/silverstripe-framework#1910: shortcodes not parsed in RSS feeds"
This reverts commit 306281ed44.
Breaks HTMLTextTest
2013-09-30 22:40:47 +02:00
Ingo Schommer
b291f3d0cd Merge pull request #2446 from jamesgoodmandia/rss-feed-placeholders
Fixes silverstripe/silverstripe-framework#1910: shortcodes not parsed in...
2013-09-30 13:01:19 -07: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
Andrew Short
43fab1088a Add a getter for the HasManyList foreign key. 2013-09-27 15:06:55 +10:00
James Goodman
306281ed44 Fixes silverstripe/silverstripe-framework#1910: shortcodes not parsed in RSS feeds 2013-09-23 16:20:06 +12:00
Ingo Schommer
b9e205abbf Allow <link/> in HTMLText->exists() (fixes #850) 2013-09-18 11:39:29 +02: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
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
03d1d58148 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	admin/code/SecurityAdmin.php
	css/AssetUploadField.css
	docs/en/topics/configuration.md
	security/PermissionRole.php
2013-09-12 17:33:36 +02: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
5e0315dc62 Safety note on DataObject::validation_enabled 2013-09-12 15:42:43 +02:00
Ingo Schommer
cb517fda9e Safety note on DataObject::$validation_enabled 2013-09-12 15:42:36 +02:00
Sean Harvey
95bb799e6f BUG Fixing SQLQuery::aggregate() adding ORDER BY when no limit.
DataQuery::initialiseQuery() will add a default sort to a query,
and when calling up an aggregate it will make a query like this
which doesn't make sense:

SELECT MAX("LastEdited") FROM "Member" ORDER BY "ID"

In this case there is no need to add the ORDER BY, and it will
break databases like MSSQL in cases such as
GenericTemplateGlobalProvider
which provides a default List() function for adding aggregates
into SSViewer template cacheblocks.

If we add a limit, however, then it does make sense:

SELECT MAX("LastEdited") FROM "Member" ORDER BY "ID" LIMIT 10

This fixes SQLQuery::aggregate() to NOT add an ORDER BY to an
aggregate call if there is no limit.
2013-09-06 18:11:11 +12:00
Johannes Hammersen, x75
b8495da5d9 BUG Cached images stored in wrong folder
If multiple image manipulations are performend the resulting cached image is stored in assets/_resampled because the cached version of the image has no ParentID, which cacheFilename needs to set the correct path.
2013-08-26 10:16:42 +02:00
Ingo Schommer
a4c6ae3e90 Merge remote-tracking branch 'origin/3.1' 2013-08-22 13:56:33 +02:00
Ingo Schommer
4a3a88710f Merge remote-tracking branch 'origin/3.1.0' into 3.1
Conflicts:
	dev/BehatFixtureFactory.php
	model/Hierarchy.php
	tests/behat/features/bootstrap/FeatureContext.php
	tests/core/CoreTest.php
2013-08-22 13:00:25 +02:00
Ingo Schommer
40c239076b Merge remote-tracking branch 'origin/3.0' into 3.1.0
Conflicts:
	model/Hierarchy.php
2013-08-22 12:55:47 +02:00
Simon Welsh
c66cc952d2 Correct line length and indentation 2013-08-21 21:27:16 +12:00
Simon Welsh
151baeede1 Correct line length and indentation 2013-08-21 18:54:05 +12:00
Ingo Schommer
a6da1f5570 Merge pull request #2294 from wilr/fixgridexport
FIX: Remove limit on GridField export
2013-08-20 14:08:18 -07:00
Will Rossiter
c7bdfcd76a Merge pull request #2293 from robert-h-curry/empty-arraylist
Preempt fatal errors when making some function calls on an empty ArrayList
2013-08-17 16:53:48 -07:00
Ingo Schommer
7ae75c1a89 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	forms/HtmlEditorField.php
2013-08-16 13:37:44 +02:00
Ingo Schommer
74f65540a2 Validate 'archiveDate' user data in Versioned
Not a security issue as such, since the user input is sanitized
before being used in Versioned->augmentSQL(). But it shouldn't
reach the session state either, since that's commonly assumed
to be sanitized data, and it leaves unnecessary room for error.

strtotime() has fairly loose validation rules around dates,
but its a good "first line of defence".
2013-08-15 22:17:38 +02:00
Ingo Schommer
0e40b779c9 UTF8 defaults for MySQLDatabase->createDatabase()
Doesn't have much effect in practice, because charset and collation
are already hardcoded on an ALTER TABLE level (field definitions),
which take priority. Since most MySQL installs will still default
to a latin1 encoding, this propagates to the table though,
confusing devs and in some cases causing wrong data.

Example: A MSSQL->MySQL DB migration tool used the table metadata
to determine the charset, creating encoding issues.

In terms of hardcoding, we don't really support anything other than UTF8,
and the field-level settings are already hardcoded.

We should probably remove the field-specific settings and rely
on the DB defaults, but that's a sensitive API change
(need to set on existing DBs during upgrade).
2013-08-15 12:49:15 +02:00
Will Rossiter
65d96e8d7c FIX: Remove limit on GridField export
Allow DataList::limit() to take a null value to remove the limit.

Added tests for limit(). Note the one failure, currently the ORM doesn't support unlimited values with an offset.
2013-08-05 19:59:12 +12:00
Robert Curry
d69520bd70 Preempt fatal errors when making some function calls on an empty ArrayList
The function "first" on ArrayList uses the PHP function "reset", which
returns false if there aren't any elements in the array. Two functions
inside ArrayList use this function, "canFilterBy" and "byID". I've
changed these functions to catch the possibility of a false return from
first().
2013-08-05 15:47:58 +12:00
Hamish Friedlander
d44024b1cf Merge branch 'origin/3.1' 2013-07-24 13:29:55 +12:00
Damian Mooyman
b3ca4a275b BUG Fixed divide by zero with SetRatioSize on missing image file
Fixes issue #2047
2013-07-23 11:24:48 +12:00
Hamish Friedlander
0a79ac3592 Merge branch 'origin/3.1'
Conflicts:
	templates/forms/CheckboxSetField.ss
	templates/forms/FormField_holder.ss
	templates/forms/OptionsetField.ss
2013-07-19 16:25:38 +12:00
Damian Mooyman
7fbc752764 Typo 2013-07-12 15:07:43 +12:00
Damian Mooyman
0e443bafa0 Deprecate Aggregate and DataObject::getComponentsQuery 2013-07-08 15:27:13 +12:00
Simon Welsh
dfc8dbdee0 Merge remote-tracking branch 'origin/3.1' 2013-07-05 10:23:59 +12:00
Simon Welsh
fbce9fd7cd Merge branch '3.1'
Conflicts:
	.travis.yml
	docs/en/misc/contributing/code.md
	javascript/HtmlEditorField.js
2013-07-05 10:22:58 +12:00
Hamish Friedlander
ca63e33c19 FIX Recent patch to DataObject#db changed API which broke core 2013-07-05 10:11:35 +12:00
Jeremy Thomerson
50e9eee2e9 FIX #2174: SearchFilter needs casting helper for DataObject base fields
Commit 964b3f2 fixed an issue where dbObject was returning casting helpers for
fields that were not actually DB objects, but had something in $casting config.

However, because dbObject was no longer calling DataObject->castingHelper, this
exposed a bug that the underlying function db($fieldName) was not returning
field specs for the base fields that are created by SS automatically on all
DataObjects (i.e. Created, LastEdited, etc).

This commit fixes the underlying issue that DataObject->db($fieldName) should
return the field specs for *all* DB fields like its documentation says it will,
including those base fields that are automatically created and do not appear in
$db.
2013-07-03 03:03:40 +00:00
Will Morgan
83726b21a2 Using extendedCan for can* 2013-06-25 16:26:38 +02:00