Commit Graph

2607 Commits

Author SHA1 Message Date
Damian Mooyman
19549d620f Moved deprecation of SQLQuery to 4.0 2014-12-04 09:30:50 +13:00
Damian Mooyman
1f4f5e68ba BUG Fix versioned
Versioned is not writing Version to _version tables for subclasses of Version dataobjects which have their own DB fields
- Fix disjoint of ID / RecordID (which should be the same)
- Fix calculation of new record version
- Fix use of empty vs !isset to check for existing version

Conflicts:
	model/Versioned.php
	tests/model/VersionedTest.php

Cherry picked from commit c140459ac6
2014-12-02 22:30:59 +02:00
Igor Nadj
77e30d4524 Cleanup, removing redundant returns 2014-11-26 15:31:07 +13:00
Igor Nadj
657606e8c8 Updating code to allow unit test to use try-catch block to catch warning
without stopping code execution inside try
2014-11-26 15:27:54 +13:00
Damian Mooyman
6baf63e18c Merge remote-tracking branch 'origin/3.1'
Conflicts:
	dev/install/install.php5
	docs/en/changelogs/index.md
	security/Security.php
2014-11-19 11:16:46 +13:00
Damian Mooyman
ce93a8a98e Resolve merge regressions 2014-11-19 11:05:07 +13:00
Damian Mooyman
2bdfd65e9b BUG Security::findAnAdministrator doesn't always find an admin 2014-11-18 15:36:34 +13:00
Damian Mooyman
0b1f297873 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	README.md
	admin/code/LeftAndMain.php
	admin/css/screen.css
	admin/scss/screen.scss
	api/RestfulService.php
	conf/ConfigureFromEnv.php
	control/injector/ServiceConfigurationLocator.php
	control/injector/SilverStripeServiceConfigurationLocator.php
	core/ClassInfo.php
	core/Object.php
	css/AssetUploadField.css
	css/ComplexTableField_popup.css
	dev/CSSContentParser.php
	dev/DevelopmentAdmin.php
	docs/en/changelogs/index.md
	docs/en/misc/contributing/code.md
	docs/en/reference/execution-pipeline.md
	filesystem/GD.php
	filesystem/ImagickBackend.php
	filesystem/Upload.php
	forms/Form.php
	forms/FormField.php
	forms/HtmlEditorConfig.php
	forms/gridfield/GridFieldDetailForm.php
	forms/gridfield/GridFieldSortableHeader.php
	lang/en.yml
	model/Aggregate.php
	model/DataList.php
	model/DataObject.php
	model/DataQuery.php
	model/Image.php
	model/MySQLDatabase.php
	model/SQLQuery.php
	model/fieldtypes/HTMLText.php
	model/fieldtypes/Text.php
	scss/AssetUploadField.scss
	search/filters/SearchFilter.php
	security/Authenticator.php
	security/LoginForm.php
	security/Member.php
	security/MemberAuthenticator.php
	security/MemberLoginForm.php
	security/Security.php
	tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php
	tests/control/HTTPTest.php
	tests/control/RequestHandlingTest.php
	tests/filesystem/UploadTest.php
	tests/forms/FormTest.php
	tests/forms/NumericFieldTest.php
	tests/model/DataListTest.php
	tests/model/DataObjectTest.php
	tests/model/TextTest.php
	tests/security/MemberAuthenticatorTest.php
	tests/security/SecurityDefaultAdminTest.php
	tests/view/SSViewerCacheBlockTest.php
	tests/view/SSViewerTest.php
2014-11-18 12:45:54 +13:00
Stevie Mayhew
41ea83b337 FEATURE: add validation to form field subclasses 2014-11-17 08:17:38 +13:00
Damian Mooyman
7f2161d7a0 Merge pull request #3599 from kinglozzer/numericfield-whitespace
Fix whitespace issues in NumericField/NumericFieldTest
2014-11-14 10:31:21 +13:00
Sam Minnée
71c354d768 Merge pull request #3623 from kinglozzer/pulls/dataobject-db-inheritance
FIX: DataObject::db() doesn't respect overloaded db types (fixes #3620)
2014-11-12 13:41:03 +13:00
Loz Calver
85b4ba15fc FIX: DataObject::db() doesn't respect overloaded db types (fixes #3620) 2014-11-11 10:41:54 +00:00
g4b0
239ed66eaf Bugfix: fixed inheritance breaks filtering if relations are included (issue #3610) 2014-11-11 10:04:41 +01:00
Loz Calver
76b833dfbb Fix whitespace issues in NumericField/NumericFieldTest 2014-11-03 09:13:54 +00:00
muskie9
082c49c1b5 Bugfix NumericField shows (none) for 0 on readonly 2014-11-02 20:57:20 -06:00
Stephen McMahon
20af30ed98 FIX GridFieldExportButton exporting only Paginated list when using ArrayList as source 2014-10-27 11:03:00 +11:00
Loz Calver
a77ca1995a Merge pull request #3521 from halkyon/bigsummary_plain_fix
BUG Text::BigSummary() fails with undefined $data when $plain = false
2014-10-25 23:30:36 +01:00
Loz Calver
2176a6dea8 Merge pull request #3576 from tractorcow/pulls/3.1/upload-attach
BUG File attach handler is no longer accessible if attachment is disallowed or disabled
2014-10-25 23:12:03 +01:00
Damian Mooyman
0a04e2e77b Merge pull request #3484 from dnadesign/object_has_extension_fix
fixed and tested object has_extension
2014-10-24 17:20:00 +13:00
John Milmine
62658a6cca fixed and tested object has_extension 2014-10-24 16:58:50 +13:00
Damian Mooyman
9d78eb7fe6 BUG Fix BasicAuth not resetting failed login counts on authentication 2014-10-24 14:19:12 +13:00
Damian Mooyman
5d27ea4be1 BUG File attach handler is no longer accessible if attachment is disallowed or disabled 2014-10-24 11:31:33 +13:00
Devlin
478edfa0c6 BUG Upload: File versioning with existing files
reinsert oldFilePath = relativeFilePath in while loop
2014-10-22 08:48:55 +13:00
Damian Mooyman
49cb38dfc1 BUG Fix static call to protected instance method 2014-10-20 17:04:25 +13:00
Sam Minnée
3d9fa205fe Merge pull request #3547 from kinglozzer/pulls/3546-apply-relation
Fix DataQuery::applyRelation for multiple relations of the same class (fixes #3546)
2014-10-15 18:00:19 +13:00
Damian Mooyman
53c40a94fa API Enable re-authentication within the CMS if a user session is lost
BUG Resolve issue with error redirection being ignored within CMS
BUG Fix issue with invalid securityID being re-emitted on failure
2014-10-14 15:19:48 +13:00
Damian Mooyman
793784e9d7 BUG Fix flushing of SSViewer cache via testing 2014-10-14 09:47:05 +13:00
Loz Calver
c52e94e98e Fix DataQuery::applyRelation for multiple relations of the same class (fixes #3546) 2014-10-13 19:46:37 +01:00
Loz Calver
97170dd42d Better tests for SSViewer::flush & Flushable 2014-10-13 09:44:14 +01:00
Sean Harvey
f86b0bbca0 Merge pull request #3459 from jdemeschew/3356-fix-js-not-properly-included
Fix #3356 js not properly included
2014-10-13 16:41:37 +13:00
Loz Calver
48eb0e67e6 FIX: Deliberately clear partial cache blocks on flush (fixes #1383)
Move property to top of class definition

Move property to top of class definition
2014-10-09 21:44:01 +01:00
Damian Mooyman
1e612607aa Suggested improvements / test case fixes 2014-10-10 09:28:11 +13:00
Daniel Hensby
3b9056fc01 NEW Cookie_Backend for managing cookie state
I've decoupled `Cookie` from the actual act of setting and getting
cookies. Currently there are a few limitations to how Cookie works that
this change mitigates:

0. `Cookie` currently changes the super global `$_COOKIE` when setting
to make the state of an application a bit more managable, but this is
bad because we shouldn't be modifying super globals
0. One can't actually change the `$cookie_class` once the
`Cookie::$inst` has been instantiated
0. One can't test cookies as there is no class that holds the state of
the cookies (it's just held in the super global which is reset as part
of `Director::test()`
0. One can't tell the origin of a cookie (eg: did the application set it
and it needs to be sent, or did we receive it from the browser?)
0. `time()` was used, so testing was made difficult
0. There was no way to get all the cookies at once (without accessing
the super global)

Todos are on the phpdoc and I'd like to write some tests for the backend
as well as update the docs (if there are any) around cookies.
DOCS Adding `Cookie` docs

Explains basic usage of `Cookie` as well as how the `Cookie_Backend`
controls the setting and getting of cookies and manages state of sent vs
received cookies
Fixing `Cookie` usage

`Cookie` is being used inconsistently with the API throughout framework.
Either by not using `force_expiry` to expire cookies or setting them to
null and then expiring them (which is redundant).
NEW `Director::test()` takes `Cookie_Backend` rather than `array` for `$cookies` param
2014-10-06 17:44:51 +13:00
Sean Harvey
776f6976c9 BUG Text::BigSummary() fails with undefined $data when $plain = false 2014-10-01 16:02:28 +13:00
Sean Harvey
c57c24eb81 Merge pull request #3464 from InfinityIo/rewrite_hash_links-SSTemplateParser-fix
Fix over-eager rewrite_hash_links regexp in SSTemplateParser
2014-09-26 18:14:08 +12:00
Nik
5258b84e5c Updated SSViewerTest to test for SSTemplateParser rewrite_hash_links fix 2014-09-26 17:41:27 +12:00
Damian Mooyman
db0cad4616 BUG ErrorControlChain now supports exception handling 2014-09-26 16:54:34 +12:00
torleif
75ec0c4791 Added tests that check comparisonClause()
AS requested by tractorcow: https://github.com/silverstripe/silverstripe-postgresql/pull/26

Tested on MySQL (succeeds as expected)  Tested on PostgreSQL (and fails as expected, but passes with patch). The fixes test only DataQueryTest related items for consistency, e.g. by avoiding DataObject calls.
2014-09-26 12:11:33 +12:00
Sean Harvey
e3056ed831 Merge pull request #3486 from jeffreyguo/pulls/html-field
Updated html field to support quotes
2014-09-26 11:16:42 +12:00
Sean Harvey
f7af0d8955 Merge pull request #3398 from dnadesign/fixsortableheader
API: Add ClassInfo::table_for_object_field to return the table name for ...
2014-09-26 11:14:33 +12:00
Will Rossiter
920978df99 API: Add ClassInfo::table_for_object_field
Returns the table name for a field in a class hierarchy.

This issue raised itself with GridFieldSortableHeader not supporting sorting on fields from parent class fields.
2014-09-26 10:38:31 +12:00
Sean Harvey
99f8fb29b5 Merge pull request #3507 from tractorcow/pulls/fix-mailer
API / FIX / Cleanup - Mailer and Convert::html2raw
2014-09-26 10:15:18 +12:00
Gabrijel Gavranović
cf456d6625 FIX use @param $colName in column call 2014-09-26 09:18:29 +12:00
Damian Mooyman
bf4e9eb044 API Singleton method allowing type inference
This pattern improves over the current usage of singleton by allowing type inference.
This also better supports refactor, code usage detection, and auto-completion of classes.
2014-09-26 09:10:25 +12:00
Sean Harvey
ee717c7f66 Merge pull request #3287 from IgorNadj/3.1
ENH making /dev extendable
2014-09-25 18:34:21 +12:00
Sean Harvey
04e26d4a36 Merge pull request #3025 from tractorcow/pulls/3.2-date-relevance
API DateTime.Ago better infers significance of date units.
2014-09-25 18:28:30 +12:00
Sean Harvey
409aebf0af Merge pull request #2515 from guttmann/html-text-absolutelink-placeholders
HTMLText AbsoluteLink parse placeholders
2014-09-25 16:07:41 +12:00
Damian Mooyman
e47800917a API Mailer can be configured to use different encoding mechanisms, and added support for unicode quoted-string encoding
API Mailer bounce email can now be configured
API Mailer no longer calls Convert::xml2raw on all email subjects
API Deprecate dead Mailer code and refactored duplicate or mis-documented code.
2014-09-25 16:04:56 +12:00
Damian Mooyman
29e3347562 API Convert::html2raw no longer wraps text automatically
BUG Convert::html2raw now correctly decodes single quotes
2014-09-25 16:04:48 +12:00
Sean Harvey
bbd4e8b8c1 Merge pull request #3462 from tractorcow/pulls/3.2/fix-versioned
BUG Fix versioned failing to generate new versions
2014-09-24 18:03:40 +12:00
Sean Harvey
6d12cf372e Merge pull request #2921 from JayDevlin/2904-upload-file-versioning
BUG Upload: file versioning uses illegal underscore in filename
2014-09-24 15:59:53 +12:00
Sean Harvey
4ae0d90c55 Merge pull request #2946 from tractorcow/pulls/3.1-fix-injector-inheritance-bug
BUG Fix issue with inheritance of Injector service configuration
2014-09-24 15:52:00 +12:00
Ingo Schommer
fb8b22c292 Merge pull request #3402 from halkyon/plural_fix
BUG Fixing plural_name messing up singular words ending in "e" (#3251)
2014-09-18 21:56:56 +12:00
Damian Mooyman
062ad8e685 API Allow parameterised joins / subselects 2014-09-16 17:54:30 +12:00
Jeffrey Guo
1f5f2a1798 Updated html field to support quotes 2014-09-12 15:09:12 +12:00
Juri Demeschew
3eabd7d41a Fix #3356 js not properly included 2014-09-09 06:59:31 +02:00
Sean Harvey
151b7e9876 Adding ability to change query distinct on DataList and DataQuery 2014-09-04 13:51:43 +12:00
Damian Mooyman
c140459ac6 BUG Fix versioned
Versioned is not writing Version to _version tables for subclasses of Version dataobjects which have their own DB fields
- Fix disjoint of ID / RecordID (which should be the same)
- Fix calculation of new record version
- Fix use of empty vs !isset to check for existing version
2014-09-02 09:14:08 +12:00
Nightjar
e4b563e596 Fixing the failure of some tests if the framework dir is named something other than 'framework' (which is a legitimate option) 2014-09-01 13:53:06 +01:00
Will Rossiter
7993875f16 FIX: Sorting a DataQuery over a relation.
When sorting a DataQuery over a relation, the SQLQuery automatically included the sort column. The issue with the implement is that potentially the joined record has a field with the same name as the source record causing it to be overridden.

In the attached test case, without the patch the title will be set to 'Bar' rather than 'Foo'.

This patch aliases the sort column. Alternativally a patch would be to
2014-08-26 17:41:38 +12:00
Igor Nadj
f823831a63 FIX making minify javascript fail-safe 2014-08-25 11:49:38 +12:00
Damian Mooyman
96d0874953 BUG Fix issue with inheritance of Injector service configuration 2014-08-25 10:23:01 +12:00
Damian Mooyman
5b553616dc API DateTime.Ago better infers significance of date units.
BUG Fixes missing i18n translation in Date::TimeDiffIn
BUG Fixes Date::TimeDiffIn not respecting mocked SS_Datetime::now
This provides less vague date periods. I.e. "36 days" has a lot more relevance that "1 month"
Reduced duplication of time period calculation code
(ref: CWPBUG-141)
2014-08-25 10:04:24 +12:00
Sean Harvey
0e07f1a7f5 Merge remote-tracking branch 'origin/3.0' into 3.1 2014-08-22 17:50:36 +12:00
Ingo Schommer
1661213e5b FIX Opt-out pf form message escaping (fixes #2796)
This fixes a limitation introduced through http://www.silverstripe.org/ss-2013-008-xss-in-numericfield-validation/.
Form messages used to accept HTML, now they’re escaped by default, effectively removing the ability
to pass in HTML and take care of escaping manually.

We pass through HTML to message in core through the CTF system, so this needs to be fixed.
It’s an alternative fix to https://github.com/silverstripe/silverstripe-framework/pull/2803.
2014-08-22 16:59:34 +12:00
Sean Harvey
8063b349c8 BUG Fixing Director::test() failing on BASE_URL prefixed URLs
Example: you have a site in a sub-directory off the webroot, you call
->Link() on a SiteTree record, which returns "/[sitedir]/my-page", and
you pass this URL to Director::test(). It's a valid URL, but
Director::test() will throw a 404.

Director::test() should be ensuring that all URLs passed to it are
properly made relative, not just in the case where it thinks the URL
is absolute.
2014-08-22 15:21:53 +12:00
Damian Mooyman
aec8430395 Merge pull request #3393 from halkyon/flushable
NEW Provide a consistent way of triggering flush
2014-08-22 10:28:26 +12:00
Sean Harvey
2b316e79e5 NEW Provide a consistent way of triggering flush
Provides an interface for classes to implement their own flush()
functionality. This function gets called early in a request on
all implementations of Flushable when flush=1|all is requested in the
URL.

This fix came out of an issue where Requirements combined files were not
being cleaned up after dev/build?flush=1, due to the fact that flush
would only occur when you called it while on a page that used those
combined files, but not in any other contexts. This will now call flush
on any implementors of Flushable regardless of the context of where
flush was called.
2014-08-22 09:24:27 +12:00
Sean Harvey
61c6dee057 BUG Fixing plural_name messing up singular words ending in "e" (#3251)
This would ideally be fixed with the ability to use an external library
like gettext, but that's an API change. This for now fixes the issue
where a singular like "Page" returns "Pags" for the plural name.
2014-08-20 14:55:40 +12:00
Devlin
4178f7beb0 test all generate methods and formatted image deletetions 2014-08-19 10:12:47 +02:00
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
Sean Harvey
404478b07f Removing @deprecated 3.1 functionality and classes.
Changelog has been updated to include what was removed in terms of
major functionality, and what to use as a replacement.
2014-08-18 16:00:13 +12:00
Sean Harvey
5f1552b365 BUG Custom label set in summary_fields config gets overridden 2014-08-14 14:19:41 +12:00
Mateusz Uzdowski
8bf3853887 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	docs/en/misc/contributing/issues.md
	docs/en/reference/uploadfield.md
	forms/HtmlEditorField.php
	i18n/i18n.php
	javascript/HtmlEditorField.js
	model/DB.php
	model/Image.php
	model/SQLQuery.php
2014-08-14 09:08:26 +12:00
John Milmine
0a36951ab1 adding exclamation mark and question mark to delimiters, made text work the same as HTML Text 2014-08-07 21:01:23 +10:00
Igor Nadj
b3d52de531 ENH making /dev extendable 2014-08-06 16:29:52 +12:00
Marcus Nyeholt
b273f3b524 API Updated aspect proxy service
- Updated AspectProxyService to handle multiple handlers for each proxied
  object's methods.
- Changed BeforeCallAspect to allow for providing a return value that
  should be returned to the caller instead of the proxied return value
- Changed AfterCallAspect behaviour to allow for returning the value of
  the aspect to the caller instead of the proxied return value
2014-08-06 13:48:26 +10:00
Sean Harvey
1759d5d017 API Use "number" HTML5 type for NumericField by default 2014-08-04 14:27:35 +12:00
Damian Mooyman
2c24d51c0b Revert #3358 2014-08-04 12:13:19 +12:00
Sean Harvey
b2dac644a0 BUG Fixed escaping of name/value in options of form fields
DropdownField was currently escaping options, but CheckboxSetField and
OptionsetField were not. This fixes them to be consistent.
2014-08-04 09:55:35 +12:00
Damian Mooyman
a89dbd29e1 Revert #3345 #3323 2014-07-31 17:05:57 +12:00
Daniel Hensby
04e5c11ed9 TEST Empty absolute urls - tests for #3323 2014-07-30 23:22:37 +01:00
Jeffrey Guo
5519a026e8 expand a tree node and check a CMS tab 2014-07-30 17:17:08 +12:00
Stig Lindqvist
333a2aa8f9 BUG: CMS tree filters doesn't count the correct number of children for deleted pages
This is a bug that combines Hierarchy, Versioned and LeftAndMain admins and CMSSiteTreeFilters.

This bug can be reproduced by having a large site tree with enough deleted pages in it so it doesn't
pre load all the children pages when initially opening an admin. Filter by either 'All pages including deleted'
or 'Deleted pages'. For CMS users it will look like deleted pages are gone.

The solution involves a couple of smaller fixes in both CMS and framework modules.

1) Ensure that 'numHistoricalChildren' are used instead of 'numChildren' when dealing with deleted pages
2) LeftAndMain::currentPage() deletes all the 'marking' cache previously built up by Hierarchy::markPartialTree()
3) Use Versioned::get_included_deleted() instead of raw DB queries against the DataObject tables when calculating parents in CMSSiteTreeFilter
2014-07-25 16:19:30 +12:00
Damian Mooyman
0433ba1642 BUG Revert some changes to ManyManyList
BUG Fix incompatibility in Member_GroupList
Fix regressions in merges from 3.1
BUG Fix Security failing on test classes
BUG Fix postgresql compatibility
Clarify sql encoding of table names
2014-07-23 12:38:41 +12:00
Senorgeno
df6a8b6fb6 BUG #3282: Added ability to subselect with in left or inner join 2014-07-17 13:27:28 +12:00
Simon Welsh
c14d58f585 Merge branch '3.1'
Conflicts:
	.travis.yml
	model/ManyManyList.php
	model/fieldtypes/DBField.php
2014-07-16 21:24:02 +10:00
Loz Calver
791ee7171b API: Prevent large images from repeatedly crashing PHP on resize 2014-07-16 09:18:51 +01:00
Damian Mooyman
d8e9af8af8 API New Database abstraction layer. Ticket #7429
Database abstraction broken up into controller, connector, query builder, and schema manager, each independently configurable via YAML / Injector
Creation of new DBQueryGenerator for database specific generation of SQL
Support for parameterised queries, move of code base to use these over escaped conditions
Refactor of SQLQuery into separate query classes for each of INSERT UPDATE DELETE and SELECT
Support for PDO
Installation process upgraded to use new ORM
SS_DatabaseException created to handle database errors, maintaining details of raw sql and parameter details for user code designed interested in that data.
Renamed DB static methods to conform correctly to naming conventions (e.g. DB::getConn -> DB::get_conn)
3.2 upgrade docs
Performance Optimisation and simplification of code to use more concise API
API Ability for database adapters to register extensions to ConfigureFromEnv.php
2014-07-09 18:04:05 +12:00
Damian Mooyman
c26df0b3c6 Revert "BUG Config::merge_array_low_into_high() ignores falsey values" 2014-07-09 09:57:25 +12:00
Sean Harvey
16e546300f BUG Config::merge_array_low_into_high() ignores falsey values
Specific case: LeftAndMain::$session_keepalive_ping = true cannot be
set to false in config.yml for some cases because the value is ignored
when merge_array_low_into_high() is processing the config arrays.
2014-07-08 15:18:26 +12:00
Sean Harvey
d1d295056b Merge pull request #3265 from stevie-mayhew/images-force-resample
FEATURE allow force resampling on images
2014-07-07 11:27:16 +12:00
Damian Mooyman
c30111eee3 Better encoding of javascript
Fixes #2988
2014-07-07 09:01:53 +12:00
Stevie Mayhew
1d86fe4f52 FEATURE allow force resampling on images 2014-07-05 14:29:01 +12:00
Damian Mooyman
d3c7e41419 BUG using isDev or isTest query string no longer triggers basic auth 2014-07-02 11:51:51 +12:00
Will Rossiter
2c741fec0c FIX Add support for compositedbfield within many_many_extraFields
Previously selectFromTable would simply try to select the composite field name. This expands the extraField name to include the children field names and uses CompositeDBField::writeToManipulation to generate the correct SQL for the queries.
2014-06-28 10:54:48 +12:00
Damian Mooyman
6ff1d3ccbc Merge pull request #3225 from halkyon/log_constants
Adding some more commonly used SS_Log priority constants.
2014-06-23 13:15:45 +12:00
Sean Harvey
9c2ddd4850 Adding some more commonly used SS_Log priority constants. 2014-06-23 11:50:05 +12:00
Sean Harvey
0ee3a683a5 Better support for overloading start and destroy methods in Session
Move functionality from static start and destroy functions into instance
methods, allowing these to be overloaded. This works the same way as
calling Session::set() which then in turn calls inst_set()

Additionally use Injector to create the default Session instance to
allow the class to be swapped out.
2014-06-20 10:35:53 +12:00
Damian Mooyman
ef03dfdd5b Merge remote-tracking branch 'origin/3.1' 2014-06-17 18:17:24 +12:00