Commit Graph

1847 Commits

Author SHA1 Message Date
Simon Welsh
624f427c2a Removes line longer than 120c 2012-10-29 10:22:53 +13:00
Will Rossiter
69ea73b4ed Merge pull request #777 from halkyon/field_edit3
Member_ProfileForm respect canEdit() permissions on Member
2012-10-27 20:11:46 -07:00
Simon Welsh
bedb579b07 Merge branch '3.0' 2012-10-23 15:21:20 +13:00
Sean Harvey
f593002b03 Merge pull request #879 from tractorcow/3.0-test-fixes
BUG / API Fixes to test cases requiring code for consolidating newlines
2012-10-17 15:24:22 -07:00
Damian Mooyman
0d7816b55d BUG Fixed issue with Deprecation failing to extract the module from a stacktrace, especially on non-unix systems
API Added Convert::nl2os function to normalise end of line characters across systems with tests
BUG Fixed i18n unit tests in non-unix systems constantly failing
BUG Fixed problems with HTMLCleaner tests failing in non-unix systems
2012-10-17 11:57:16 +13:00
Mateusz Uzdowski
8eb0fa91bd API Add the ability to query if the schema update is in progress.
The specific situation where this is useful is where populateDefaults on
DataObjects needs to query the database. This will break the dev/build
when it tries to create the object via singleton - the query will not be
able to be executed if the table is not there or its schema has changed.

For an example of such use case see Translatable::populateDefaults.
2012-10-17 11:45:21 +13:00
Ingo Schommer
1181ba089a Merge remote-tracking branch 'origin/3.0'
Conflicts:
	.travis.yml
2012-10-16 10:26:04 +02:00
Sean Harvey
a171c7e4b0 BUG Fixing regression in 26d70d6fca with formatted output in SS_HTMLValue
If formatOutput is set to TRUE, then the regexes in getContent()
will not match the newlines, and the output will include html, body
and meta tags. Introduce a few new tests to ensure the output is
correct, and fix the regex.
2012-10-16 11:59:30 +13:00
Sean Harvey
f6a90467e4 Merge branch '3.0' 2012-10-15 10:10:01 +13:00
Ingo Schommer
5be3a4c35a NEW DataList->filterAny() 2012-10-12 15:24:25 +02:00
Robert Curry
4c35c302d2 Exclude test/travis/_config.php from being include in the test manifest. 2012-10-12 17:07:42 +13:00
Simon Welsh
c49f7566c3 API Allow use of :not, :nocase and :case modifiers to SearchFilters.
More modifiers can be added to each class as desired.
2012-10-10 10:26:47 +13:00
Simon Welsh
2faf7d112d API Allow using SearchFilters in DataList::exclude() 2012-10-09 14:47:22 +13:00
Ingo Schommer
38e7df2e91 NEW Enable SiteTree::$nested_urls by default 2012-10-08 17:05:05 +02:00
Ingo Schommer
d1ee7612f5 Merge remote-tracking branch 'origin/3.0' 2012-10-08 16:48:52 +02:00
Normann Lou
9aaa6b1a7b ENHANCEMENT: change those harded-coded 'sapphire' to 'framework' either in javascript code or inline document, or a <a> href propty. 2012-10-05 17:00:39 +13:00
Simon Welsh
5768e421dc Merge branch '3.0' 2012-10-05 14:40:32 +13:00
Simon Elvery
de36063d15 ENHANCEMENT Make it possible to extend SS_Log
Using late static binding makes it possible to override SS_Log to create
logs which are separate to the main Silverstripe log but still use the
built in functionality.

Add test for SS_Log subclassing.
2012-10-04 16:34:20 +10:00
Ingo Schommer
fb5e488103 Line length fixes 2012-10-03 18:11:31 +02:00
Ingo Schommer
56f7ce1dcf Merge remote-tracking branch 'origin/3.0'
Conflicts:
	control/Cookie.php
	control/Director.php
	control/HTTPResponse.php
	model/Database.php
	model/MySQLDatabase.php
	model/SQLQuery.php
	view/Requirements.php
	view/SSViewer.php
2012-10-03 16:16:19 +02:00
Ingo Schommer
ef81318aea BUG Retaining join extraFields on ManyManyList->add() 2012-10-03 14:58:28 +13:00
Damian Mooyman
f265595c1e NEW: GridFieldPageCount control for displaying the current page count/total in the gridview header. Designed to complement a functional pager in the grid footer.
NEW: GridFieldPageCount widget to default config settings
FIX: @extend .col_buttons in GridField.scss which was raising a warning
2012-10-03 14:54:37 +13:00
Sam Minnee
b7e7c165ff NEW Amend Travis build to run a simple PHP_CodeSniffer test.
At this stage, the test just checks line-length and line-endings, but previous commits have ensured that framework actually passes those tests.  We can add more tests as we actually correct the code to pass those tests, and grow the test suite, as we had for unit tests.
2012-09-30 17:28:46 +13:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
356a367eb5 BUG Setting response length directly before output (fixes #7574)
Complying to HTTP1.1/RFC2616 in terms of when to
set 'Content-Length' in the first place
2012-09-29 17:24:33 +02:00
Frank Mullenger
a602ba5941 BUGFIX: Old version of SimpleTest does not recognise input fields of
type 'email'.
2012-09-28 12:07:54 +12:00
Damian Mooyman
d54ef36b47 FIXED: CSV Test cases now use platform-correct linebreak characters 2012-09-27 13:54:19 +12:00
Damian Mooyman
5ea2c3dc5a FIXED: Unnecessarily strict comparison of path separators in windows filenames 2012-09-27 13:41:28 +12:00
Sam Minnee
39952f4a5c API: Added 'onBeforeHTTPError' and 'onBeforeHTTPError<code>' extension points to RequestHandler::httpError().
These APIs are primarily intended to let developers write custom 404 handlers.  They can define an onBeforeHTTPError404() method on an Extension that gets added to Controller or RequestHandler.

The SS_HTTPResponse_Exception object has also been tidied up to override the status info of any SS_HTTPResponse object that might get passed.  This is mainly to make it easier for callers (such as ContentController and ModelAsController) to use RequestHandler::httpError() more consistently.
2012-09-27 12:26:25 +12:00
Ingo Schommer
33f67e1ad8 Fixed FulltextSearchable regression from 21a6390d 2012-09-26 11:28:25 +02:00
Howard Grigg
aa6f345d1d API FormField::name_to_label() for unlabelled fields
Will convert camel case to spaces, e.g. "TotalAmount"
to "Total Amount".
2012-09-26 11:20:34 +02:00
Simon Welsh
6d696d506f API Allow subgroups in the WHERE clause of a Data/SQLQuery
Adds three extra methods to Data/SQLQuery query that allow for starting
a disjunctive subgroup, a conjunctive subgroup and for ending a subgroup.

Database::sqlWhereToString() now builds up the WHERE clause one by one
instead of with a straight implode. Uses a stack to know which conenctive
to use.
2012-09-21 14:59:47 +12:00
Simon Welsh
1e629f4585 Merge branch '3.0'
Conflicts:
	control/Cookie.php
	control/Director.php
	dev/Profiler.php
	view/Requirements.php
2012-09-21 14:56:56 +12:00
Ingo Schommer
e44a3558dd Merge pull request #793 from halkyon/htmlvalue_parsing_fixes
BUG HtmlEditorField doesn't save HTML fragments in HTMLValue correctly
2012-09-20 02:09:36 -07:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Sean Harvey
b075fa29c5 Have tiny_mce_gzip.php use local silverstripe-cache folder if available
This is a fix for ticket #7670. Some hosting situations don't
allow write access to the system temp path. tiny_mce_gzip.php is currently
using sys_get_temp_dir() by default, and not using a local silverstripe-cache
folder that may exist in the SilverStripe project.

This change moves the getTempFolder() function into a common file, and
includes that in core/Core.php, as well as thirdparty/tinymce/tiny_mce_gzip.php
so both locations share the same code to work out the temp path.
2012-09-19 16:43:17 +12:00
Sean Harvey
26d70d6fca BUG HtmlEditorField doesn't save HTML fragments in HTMLValue correctly
The issue was raised in #7628, where an anchor tag was being changed from
<a name="anchor"></a> to <a name="anchor"/> by SS_HTMLValue, when
HtmlEditorField::saveInto() parses the HTML fragments.

This is because SS_HTMLValue uses DOMDocument::saveXML(), which is fine
for saving an XML document, but not suitable for HTML. This fix changes
that to use DOMDocument::saveHTML() instead.
Note that we can't use the parameter to saveHTML() for selecting a single
node only, as that's only supported in PHP 5.3.6+, SilverStripe 3.0 supports
PHP 5.3.2 as a minimum. The workaround for this shortcoming is to replace
unncessary output by DOMDocument with a regular expression.
2012-09-19 11:39:01 +12:00
Simon Welsh
4e3c684b62 Merge branch 'bugfix/apishortcodes' of https://github.com/elliot-sawyer/sapphire into 3.0 2012-09-18 16:36:11 +12:00
Sam Minnée
651f45e0e4 Merge pull request #782 from tractorcow/3.0-index-generation-fixes
FIXED: Generation of table indexes
2012-09-16 23:43:17 -07:00
Elliot Sawyer
71758c782f ISSUE 7833: Invoke ShortcodeParser on RestfulServer output 2012-09-17 17:53:51 +12:00
Sean Harvey
9c2be0f025 Merge branch '3.0' 2012-09-17 15:16:52 +12:00
Damian Mooyman
0e997d0285 FIXED: Cleaned up test case, made sure it initialised consistently and correctly
ADDED: Extra assertions to test case to ensure that different expressions of the same index definition were treated as non-changes.
2012-09-14 14:55:07 +12:00
Ingo Schommer
b0fc1cb16a Merge branch '3.0.2' into 3.0 2012-09-12 11:05:50 +02:00
Ingo Schommer
99b1bc672b Don't rely on hardcoded IDs in DataListTest (breaks postgres) 2012-09-12 10:51:40 +02:00
Ingo Schommer
8772eb3e18 Merge branch '3.0.2' into 3.0 2012-09-12 09:50:38 +02:00
Ingo Schommer
d5313aa6a4 BUG Fixed SSViewerTest execution in non-dev environments 2012-09-12 09:50:10 +02:00
Damian Mooyman
30e15d11a7 FIXED: Generation of tables with fulltext indexes now no longer incorrectly thinks that all fulltext indexes have changed.
ADDED: Test cases correctly checking for changes (and no changes) to the data model for both fields and indexes.
FIXED: References to indexes throughough the code that probably should have quoted field names. This prevents a lot of 'spam' during dev build. This includes an updated FulltextSearchable test case.
2012-09-11 12:53:08 +12:00
Sean Harvey
e73d28b24e Fixing unit test to restore extensions after test 2012-09-10 14:09:40 +12:00
Ingo Schommer
1088d044c5 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	.travis.yml
2012-09-07 17:21:41 +02:00
Sean Harvey
5cbd2dbeb4 BUG CMSProfileController::Member_ProfileForm() respecting canEdit() permissions on Member
CMSProfileController currently checks canView() which ensures that a logged in CMS
Member can access the profile controller, but when saving the record on Member_ProfileForm
there is no check for canEdit(), so extended permissions don't get respected.

This adds a check for canEdit() in Member_ProfileForm, and adds some functional tests
to check permissions.
2012-09-07 11:24:47 +12:00
Simon Welsh
4ead89a4d0 API Adds getManipulatedList() method to GridField to get the SS_List after applying Manipulators 2012-09-06 23:42:48 +12:00
Sean Harvey
b6a6c4670e NEW Allow setting default cache lifetime, and test that it's being used correctly on new caches 2012-09-03 12:55:19 +12:00
Ingo Schommer
2facc31e1f BUGFIX Case insensitive search filters for PostgreSQL (fixes #6548) 2012-09-02 23:02:20 +02:00
Ingo Schommer
a71077c9e9 Merge branch 'aa_function' of git://github.com/simonwelsh/silverstripe-framework into simonwelsh-aa_function 2012-08-29 11:58:02 +02:00
Simon Welsh
78fdcc580b API DataList->leftJoin()/innerJoin() args no longer escaped
The table name in the join was being escaped, though table
names aren't escaped anywhere else. This breaks
namespaced classes, which rely on unescaped backslashes.
2012-08-29 11:54:42 +02:00
Sam Minnée
c738744c38 Merge pull request #740 from tractorcow/3.0-route-fixes-alt
FIXED: Issue where route table arguments would not be accessible without using non deprecated API
2012-08-28 17:41:30 -07:00
Sam Minnee
09e3fa4e6a Removed pre-emptive dev/build from travis test run, to make it faster. 2012-08-29 12:10:58 +12:00
Simon Welsh
9d2686130c Merge cd61b61 from master 2012-08-29 11:18:41 +12:00
Sam Minnee
abbce151d9 Updated Travis-CI configuration to have a 4 build grid.
The Travis config will now run tests on the following instances

 * 5.3 + SQLite
 * 5.3 + MySQL
 * 5.3 + PostgreSQL
 * 5.4 + MySQL

In other words, with the exception of Windows tech (MSSQL + Win server) this is a wide-coverage build config.
2012-08-28 16:25:26 +12:00
Sam Minnee
c2afca2cd8 Merge branch '3.0' 2012-08-28 16:08:57 +12:00
Sam Minnée
93cdb83ac8 Merge pull request #738 from simonwelsh/lsb-53-30
FIX Removes version checking for LSB in Object::static_lookup()
2012-08-27 21:07:29 -07:00
Ingo Schommer
a8f335360b Merge remote-tracking branch 'origin/3.0' 2012-08-27 09:25:59 +02:00
Hamish Friedlander
8b6e4f5a90 Add some basic tests for ConfigManifest#relativeOrder 2012-08-27 16:42:25 +12:00
Damian Mooyman
9b6216d967 FIXED: Error in test case deprecation 2012-08-27 11:04:16 +12:00
Damian Mooyman
c2a8eec43c APICHANGE: Changed behaviour of HTTP_Request::params to include route table params (as per 2.4 behaviour, see FIX: below).
ADDED: HTTP_Request::params() to retrieve all (shifted) params used in the request
FIXED: Issue where route-table level arguments would not be accessible without using non-deprecated API.
ADDED: Test case to test the above items
UPDATED: Extended Director::test to allow for the retrieval of the request object
UPDATED: Deprecated notice on Director::urlParam and Director::urlParams
REMOVED: Unused variable
FIXED: Coding convention conformity
2012-08-27 10:56:59 +12:00
Simon Welsh
e159a68f89 FIX Removes version checking for LSB in Object::static_lookup()
Late static binding was added in PHP 5.3, not 5.4. As such, the check for 5.4
and then fallback to Reflection isn't needed.
2012-08-23 17:51:29 +12:00
Simon Welsh
cd61b61a84 FIX Use array_intersect() with expected values so that the order matches.
The values in $values aren't returned in any order, so this test can randomly fail. This
changes the check from expected = $values to $values \cap expected = $value. PHP's array_intersect
maintains the keys of the first array, so order is preserved. The intersect also guarentees that the
only accepted values are the expected ones.
2012-08-23 17:36:59 +12:00
Simon Welsh
f1db583fb4 NEW Allow arguments to be passed to allowed_action checkers
This allows arguments to be passed along in an $allowed_actions deceleration of
the form 'action' => '->method' in the same way that arguments can be passed to
extension constructors when adding them using $extensions or
Object::add_extension.

I.e. 'action' => '->checkerMethod(false, 7, 2, "yesterday") would call the
checkerMethod method with the boolean false the numbers 7 and 2 and  the string
"yesterday" as its arguments.
2012-08-23 17:05:12 +12:00
Sam Minnee
824afffd2e Merge branch '3.0' 2012-08-23 12:39:41 +12:00
Sam Minnee
f6334dd017 Added default sort to test data for better cross-db performance. 2012-08-23 12:38:33 +12:00
Fred Condo
3e0782267c Allow scheme-relative URLs in requirements
The Requirements class currently treats only absolute URLs as URLs, and
tries to interpret anything else as a filesystem path. This prevents
using scheme-relative URLs for requirements.

Example:
<% require javascript(//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js) %>

This forces the unfortunate choice of not using a CDN for common
scripts, always using an https absolute URL, or accepting that some
browsers will throw a security warning when viewing the site in https.

This change allows scheme-relative URLs & updates RequirementsTest.
2012-08-22 16:49:55 -07:00
Sam Minnee
866d9a94ee Updated Travis-CI configuration to have a 3 database build grid. 2012-08-21 10:42:34 +12:00
Ingo Schommer
4cc82e906b Merge remote-tracking branch 'origin/3.0' 2012-08-20 10:13:55 +02:00
Sam Minnée
47b56d4ef8 Merge pull request #716 from tractorcow/3.0-versioned-fixes
FIXED: Crashed caused by viewing versioned page
2012-08-19 19:02:24 -07:00
Damian Mooyman
89728acece UPDATED: Improved get_all_versions test case to test versions in the middle of version updates. 2012-08-20 13:48:48 +12:00
Damian Mooyman
56fe7f881a REMOVED: Unnecessary publish actions from test cases
ADDED: Test case for get_all_versions
2012-08-20 13:44:56 +12:00
Damian Mooyman
0f09305e3d FIXED: Issue where temporary table would cause unpredictable behaviour. Temporary table functionality was substituted with subqueries in each use case.
ADDED: Test case for version archive functionality.
2012-08-20 13:24:28 +12:00
Ingo Schommer
6d41cd8d09 Merge pull request #686 from wilr/3.0-rssfeed
FIX: use standard template rendering process for RSS feeds
2012-08-16 14:45:44 -07:00
Ingo Schommer
5a2247a440 Merge pull request #589 from simonwelsh/absolute_url
FIX Director::is_absolute_url() now ignores query string
2012-08-16 11:50:29 -07:00
Sam Minnee
2dadc77e99 Revert "Make PHPUnit bootstrap add flush=1"
This reverts commit e0037967c2.

Conflicts:

	tests/travis/_ss_environment.php
2012-08-14 19:01:30 +12:00
Sam Minnee
fe1434678b Revert "Make PHPUnit bootstrap add flush=1"
This reverts commit e0037967c2.

Conflicts:

	tests/travis/_ss_environment.php
2012-08-14 19:00:57 +12:00
Sam Minnee
2c62dda47a Fixed Travis CI and make it use SQLite 2012-08-14 17:02:28 +12:00
Sam Minnee
e0037967c2 Make PHPUnit bootstrap add flush=1 2012-08-14 17:02:12 +12:00
Sam Minnee
0e08840ff9 Fixed Travis CI and make it use SQLite 2012-08-14 16:45:13 +12:00
Sam Minnee
4d1c2ed4fc Make PHPUnit bootstrap add flush=1 2012-08-14 16:44:32 +12:00
Sam Minnee
8d92046769 Added support for Travis CI 2012-08-14 16:06:21 +12:00
Sam Minnee
04e3beddf5 Added support for Travis CI 2012-08-14 16:02:12 +12:00
Will Rossiter
7558d32da6 FIX: use standard template rendering process for RSS feeds
This changes the behaviour of output to browser to use the standard SilverStripe rendering process rather than an echo statement to enable easier testability.
2012-07-31 20:38:41 +12:00
Hamish Friedlander
95d0be636c Merge remote-tracking branch 'origin/3.0' 2012-07-25 11:44:53 +12:00
Hamish Friedlander
36c8fc2e93 Merge pull request #660 from silverstripe-rebelalliance/trac/7673
API Prep ArrayList, DataList, forForeignID for immutability in 3.1 per 7673
2012-07-22 21:30:53 -07:00
Hamish Friedlander
e160b76df5 BUG 7362 dont include trailing space in bare string 2012-07-23 15:42:58 +12:00
Hamish Friedlander
b7691077cf API Prep forForeignID for immutability in 3.1 per 7673 2012-07-23 10:31:47 +12:00
Ingo Schommer
3ae8b0b665 Merge remote-tracking branch 'origin/3.0' 2012-07-18 15:00:06 +02:00
Ingo Schommer
1a91431d39 Query param searches for GridFieldAddExistingAutocompleter
Fixes issues with query construction in JS when the search URL
already contains GET paramters (e.g. when using the 'translatable'
module).
2012-07-17 13:26:33 +02:00
Mateusz Uzdowski
70dcb55fe0 BUG Use prepStringForDB consistently across the framework.
Also remove a line from DBFieldTest, it's redundant with the previous
line.

Ref: os7229
2012-07-17 14:27:58 +12:00
Saophalkun Ponlu
c555256890 BUGFIX: PaginatedList::getIterator() trims the original list to the page lenght when the source list is DataList 2012-07-15 01:02:49 +12:00
Ingo Schommer
712f28bc78 Scoped deprecation messages (fixes #7645) 2012-07-13 11:37:35 +02:00
Ingo Schommer
bc1c7f766a Add sorting to GridFieldDetailFormTest fixtures
Broke SQLite3 tests in some cases due to random ordering of results.
2012-07-06 12:42:42 +02:00
Ingo Schommer
64669938da Warning when running tests without flush=1
This is now the default setting for both "sake" and "phpunit"
runs, because of performance reasons (every manifest flush takes
multiple seconds). On the other hand, we want to make errors
like missing classes more obvious to developers.
See discussion in https://github.com/silverstripe/sapphire/pull/620
2012-07-06 12:01:21 +02:00
Ingo Schommer
c072dc4757 Merge pull request #620 from chillu/pull/no-flush-on-tests
No flush in framework/tests/bootstrap.php (kills TDD) (for 3.0 branch)
2012-07-06 03:00:57 -07:00