Commit Graph

2834 Commits

Author SHA1 Message Date
Ingo Schommer
eec37c2694 BUGFIX Using mock controller in RestfulServiceTest to avoid problems with missing require() calls for PHPUnit/Framework.php (performed in recently merged PHPUnitWrapper::init() which is never called for "nested" true HTTP calls within unit tests). Mostly merged from branches/2.4.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111837 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
9994a9c948 BUGFIX Renamed PHPUnit wrappers not to use underscores in classnames, as this confuses ManifestBuilder prior to the 2.4 release
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111836 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
1176bab306 MINOR: added phpdoc to the new PHPUnitWrapper classes.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111835 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
d3d9e4560b ENHANCEMENT: refactored runTests, using the new phpunit wrapper classes.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111834 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
a57a027c43 API-CHANGE: remove include which is not required.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111833 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
534da4e076 ENHANCEMENT: Created a phpunit wrapper class to ensure that Sapphire's test framework is capable of running unit tests, coverage report and retrieve clover-statistics for PHPUnit 3.4 and PHPUnit 3.5
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111832 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
a5dfb6257d ENHACENEMENT: Change behaviour of the MenufestBuilder to use spl_autoload_register instead of traditional __autoload.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111831 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
bdd30fa4fd API CHANGE Don't reflect changes in File and Folder property setters on filesystem before write() is called, to ensure that validate() applies in all cases. This fixes a problem where File->setName() would circumvent restrictions in File::$allowed_extensions (fixes #5693)
API CHANGE Removed File->resetFilename(), use File->updateFilesystem() to update the filesystem, and File->getRelativePath() to just update the "Filename" property without any filesystem changes (emulating the old $renamePhysicalFile method argument in resetFilename())
API CHANGE Removed File->autosetFilename(), please set the "Filename" property via File->getRelativePath()
MINOR Added unit tests to FileTest and FolderTest (some of them copied from FileTest, to test Folder behaviour separately)
ENHANCEMENT Added File::$allowed_extensions (backport from 2.4 to enable File->validate() security fix)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@108062 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
c1295753b9 BUGFIX: Don't allow direct access to PHP files in sapphire module, except for main.php and static-main.php (from r108023)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@108043 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
dd696808b5 MINOR Added querystring option to Makefile (from r103884)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@103897 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
28e20364fd ENHANCEMENT Allowing TestRunner? to skip certain tests through the ?SkipTests?=... GET paramete (merged from branches/2.3-nzct) (from r80646)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@103684 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
0b79e85cc8 MINOR: Fixed FileTest execution if the assets/ directory doesn't exist. (from r88353) (from r98086)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@103521 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Sean Harvey
8e5239ff57 MINOR Fixed missing closing <div> in ContentController->successfullyinstalled() (from r101254)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@101258 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
b83797de10 BUGFIX Don't delete index.php after successful installation - in ContentController->deleteinstallfiles(). URL routing might rely on it without mod_rewrite.
BUGFIX Require ADMIN permissions for ContentController->deleteinstallfiles() - together with retaining index.php this removed a vulnerability where unauthenticated users can disrupt mod_rewrite-less URL routing. (from r101227)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@101229 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
e3c6732551 BUGFIX Fixing Member_ProfileForm to validate for existing members via Member_Validator to avoid CMS users to switch to another existing user account by using their email address (from r100704) (from r100717)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@100744 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
da691ecb0c MINOR Readded sapphire/thirdparty modules without svn:externals
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@99765 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
add3165333 MINOR Fixed HTTPTest->testSetGetVar() (merged from r98409)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98410 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
5b8161012c MINOR Fixed HTTPTest->testSetGetVar() (merged from r98407)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98408 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
8698e94ae0 MINOR Added test case for Hierarchy::getDescendantIDList() which also tests Hierarchy::loadDescendantIDListInto() (merged from r98369)
MINOR Testing of grand-children items in HierarchyTest::testLoadDescendantIDListIntoArray() and HierarchyTest::testNumChildren() (merged from r98376)
BUGFIX #5044 Hierarchy::loadDescendantIDListInto() now uses Object::getExtensionInstance('Hierarchy') instead of going through call(), as PHP 5.3 has issues converting references to values
BUGFIX Fixed Hierarchy->loadDescendantIdList() to call setOwner() on the extension instance. This was necessary due to underlying Object/Extension changes in 2.4. (merged from r98403)
MINOR Fixed HierarchyTest assertions around including grand children counts (merged from r98403)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98405 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
58dc696497 MINOR Fixed HTTPTest when invoked through dev/tests/all or with GET parameters (see r98373) (merged from r98383)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98384 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
b3931cc707 API CHANGE HTTP::setGetVar() always returns absolute URLs. Use Director::makeRelative() to make them relative again. (merged from r98373)
API CHANGE HTTP::setGetVar() combines any GET parameters in PHP array notation (e.g. "foo[bar]=val") instead of replacing the whole array (merged from r98373)
BUGFIX HTTP::setGetVar() uses parse_url() and http_build_query() to add query parameters to an existing URL, instead of doing its own regex-based parsing. This means existing GET parameters are correctly url encoded. (merged from r98373)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98375 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Andrew O'Neil
8906391495 BUGFIX: Don't force SSL when running from CLI
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98273 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
747b0996fe BUGFIX Disabled ?debug_profile=1 on live environment types (merged from r80057)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98230 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Ingo Schommer
0c684b8061 BUGFIX Limiting ?debug_memory parameter to development environments through using Debug::message() instead of a straight echo() (merged from r74067)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98229 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Sam Minnee
909de1f454 ENHANCEMENT: Removed dev/reset, instead encouraging the use of dev/tests/startsession for tests.
ENHANCEMENT: Let people use dev/tests/startsession without a fixture, instead calling requireDefaultRecords

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98081 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Will Rossiter
cd64c943f7 MINOR: fixed notice level error when ImageSource isnt set
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@97004 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Will Rossiter
efce7b9274 BUGFIX: fixed TaskRunner generating link with 2 slashes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@96998 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Normann Lou
f8f446fea4 BUGFIX: convert ImageFormAction form prototype syntax to jQuery syntax
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@94304 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Will Rossiter
2d23990869 BUGFIX: fix for multiple EmailField validation on one form. Merged via r78565
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@93483 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Sean Harvey
24cead4d33 MINOR Merged in Versioned::get_all_versions() fix from r76223
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@92161 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Sam Minnee
727f930e31 BUGFIX: Made use of new BasicAuth::protect_entire_site() consistent. (from r91658)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@91660 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Sam Minnee
22affb95c8 BUGFIX: Don't enable site-wide protection by default (from r91609)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@91611 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Sam Minnee
a2fc20de22 API CHANGE: Replaced BasicAuth::enable() with BasicAuth::protect_entire_site()
API CHANGE: BasicAuth::requireLogin() no longer has an option to automatically log you in.  You can call logIn() on the object returned, instead. (from r91603)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@91610 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Normann Lou
5d71f30794 MINOR: CheckboxSetField::dataValue() returns a string not array.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@91105 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Ingo Schommer
4443df7b0a API CHANGE: Added SapphireTest::logInWithPermission() (merged from r89209)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@91034 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Sam Minnee
15f1905889 BUGFIX: Added rewriteHashlinks = 'php' option to SSViewer so that static publisher can handle internal hashlinks properly.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@89611 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Andrew O'Neil
ad7c4eca89 reverted
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@88282 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Andrew O'Neil
e21297ecc0 BUGFIX: Ensure ASSETS_PATH is respected
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@88281 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Sam Minnee
98dda12a9d API CHANGE: Added increase_time_limit_to(), which respects safe_mode.
API CHANGE: Added no-arg option to increase_memory_limit_to() (from r80241)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@88176 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Sam Minnee
cb21b2947d BUGFIX #4579: Translatable's call to new LanguageDropdownField() broked (from r87456)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@87458 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Jeremy Warne
05c51f4aaf BUGFIX: was being passed to foreach without a check to see if it's an array or not.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@86202 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Sean Harvey
900812eb75 BUGFIX Fixed Member::sendInfo() assumptions that broke with an API change in r84594
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@85779 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Jeremy Warne
11283a8f51 BUGFIX: findByTagAndAttribute is unintentionally expanding any php found in the href/src components its regex extracts. Changed double quotes to single quotes to fix this.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@85632 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Sam Minnee
f516236cc7 API CHANGE: Template codes can no longer be used in emails except when using .ss files.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84594 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Jeremy Warne
23127243b3 BUGFIX: Added required javascript files (behaviour, prototype, prototype_improvements) to the Field() method of TreeDropdownField.php
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84332 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Jeremy Warne
a2330f31c1 BUGFIX: Added required javascript files (behaviour, prototype, prototype_improvements) to the Field() method of TreeSelectorField.php
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84320 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Sam Minnee
427cce498d API CHANGE: Make Object::uninherited_static() have a separate execution path to Object::get_static(), for more reliable operation. The intention is that for any given static, you either use Object::get_static() or you use Object::uninherited_static() - not both. (from r84151, r84155, r84156)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84157 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Andrew O'Neil
38846653a2 FEATURE: Allow different user groups to have different HtmlEditorConfigs
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84085 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Sam Minnee
047d17d512 MINOR: Reverted r83936 because it was inappropriate - only page-relative hashlinks should be rewritten
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84060 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Tom Rix
cd73e27fe1 MINOR fix rewrite of anchors
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@83936 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00