Commit Graph

290 Commits

Author SHA1 Message Date
Damian Mooyman
d2c6c539d2 Merge pull request #6872 from sminnee/fixture-by-table
NEW: Allow SapphireTest::objFromFixture() to accept either table or class
2017-05-05 15:14:01 +12:00
Damian Mooyman
942c0257b7 API Upgrade to behat 3 2017-05-05 14:32:07 +12:00
Sam Minnee
1691e90fbd NEW: Allow SapphireTest::objFromFixture() to accept either table or class
Right now SapphireTest::objFromFixture() requires a class as the first
argument. This is fine when your fixture file uses classes as the keys,
but if populating a fixture via tables, objFromFixture() won’t work.

This patch lets you specify either the table name or the class name as
the key.

The benefit here is that you can build fixtures as raw inserts, which is
substantially quicker, and is likely to be a useful tool in building
more efficient test suites.
2017-05-05 10:53:49 +12:00
Damian Mooyman
8b9f41d4f4 BUG Fix ApcuCache and MemCache namespace 2017-05-04 12:17:33 +12:00
Damian Mooyman
0c52ea067c BUG Fix incorrect text collection of __CLASS__ following an Name::class constant (#6868) 2017-05-04 10:19:05 +12:00
Damian Mooyman
edcb46bd3a Merge pull request #6836 from sminnee/cli-error-fix
FIX: Show detailed errors on CLI for live environments
2017-05-03 15:49:09 +12:00
Sam Minnee
4c772c80c3 FIX: Show detailed errors on CLI for live environments
API: Add HTTPOutputHandler::setCLIFormatter

Fixes https://github.com/silverstripe/silverstripe-framework/issues/6835

This provides detailed errors (but not warnings or notices) in CLI calls
on live environments.

It does this by adding a 2nd argument to our output handler,
CliFormatter. This formatter will be used when Director::is_cli() is
true.
2017-05-01 15:28:48 +12:00
Damian Mooyman
12fc690d80 Merge pull request #6850 from robbieaverill/bugfix/i18n-lang-region-same
FIX IntlLocales::validate when lang and region are the same e.g. de_DE
2017-05-01 08:41:44 +12:00
Damian Mooyman
3f9528a073 Merge pull request #6849 from robbieaverill/bugfix/extension-arguments-in-sapphiretest
FIX Regression from 3.x: allow $required_extensions to have arguments
2017-04-28 20:29:11 +12:00
Robbie Averill
3a372a1f41 FIX IntlLocales::validate when lang and region are the same e.g. de_DE 2017-04-28 17:19:27 +12:00
Damian Mooyman
699d5d6a42 Fix i18nTextCollector handling of special string characters 2017-04-28 14:59:42 +12:00
Uncle Cheese
d51c4891e2 New namespaced i18n keys 2017-04-28 14:59:42 +12:00
Uncle Cheese
494cbd1875 Ran upgrader for lang files 2017-04-28 14:59:42 +12:00
Ingo Schommer
22f232ed4d Mark up <time> in validation errors
Allow better localisation of values in JS
2017-04-27 21:44:52 +12:00
Robbie Averill
c95c6c466f FIX Regression from 3.x: allow $required_extensions to have arguments 2017-04-27 17:59:52 +12:00
Ingo Schommer
cbe534c675 Fixed component capitalisation 2017-04-27 15:36:18 +12:00
Ingo Schommer
94b49e3e28 Removed unused field 2017-04-27 15:36:11 +12:00
Ingo Schommer
60706c8efd Store $value in ISO and server timezone consistently, fix min/max timezone handling 2017-04-27 14:59:11 +12:00
Ingo Schommer
628fd216ad PHPDoc fixes 2017-04-27 11:56:23 +12:00
Ingo Schommer
f01a20d5c4 Only used normalised ISO on HTML5 2017-04-27 11:56:18 +12:00
Ingo Schommer
de8abe1167 API rename 2017-04-27 11:53:43 +12:00
Ingo Schommer
b852a76334 Consistent schema keys 2017-04-27 11:47:04 +12:00
Ingo Schommer
14b3468eee Removed setting format in getter
That’s already handled in getFormatter()
2017-04-27 11:09:59 +12:00
Ingo Schommer
655b047d80 Removed superfluous methods 2017-04-27 11:09:43 +12:00
Ingo Schommer
d3afa0c3b5 Remove array check since setSubmittedValue() no longer supports it 2017-04-27 10:59:44 +12:00
Ingo Schommer
958736502a Removed “T” str_replace, more comments 2017-04-27 10:32:22 +12:00
Ingo Schommer
1ec2abe75f Fixed timezone and normalised ISO handling
A few observations:
- ISO says “T” is optional (https://en.wikipedia.org/wiki/ISO_8601#cite_note-21),
- WHATWG says in the HTML5 spec that it’s optional (https://html.spec.whatwg.org/multipage/infrastructure.html#local-dates-and-times)
- W3C says it’s reqiured in 1997 (https://www.w3.org/TR/NOTE-datetime), but then later says it’s optional in its HTML5 spec (https://www.w3.org/TR/html5/infrastructure.html#floating-dates-and-times).
- Chrome doesn’t parse values with whitespace separators (requires "T")
- DataObject DBDatetime values and database columns use whitespace separators (and will have many devs relying on this format)
- MySQL only supports whitespace separators (https://dev.mysql.com/doc/refman/5.7/en/datetime.html)
- SQLite can parse both ways (https://sqlite.org/lang_datefunc.html)

So the goal here is to retain ORM/database compatibility with 3.x (whitespace separator),
while exposing "T" separators to the browser in HTML5 mode.

Regarding timezones, this fixes a regression where setValue() would not actually
apply the timezone (last $value assignment is ineffective now that sub fields are removed).
2017-04-26 22:55:29 +12:00
Ingo Schommer
e97783b057 Better second handling 2017-04-26 22:45:08 +12:00
Ingo Schommer
d2132e85db More specific localisations 2017-04-26 22:45:07 +12:00
Saophalkun Ponlu
dba1f61f13 Fix tests related to date time 2017-04-26 22:45:07 +12:00
Saophalkun Ponlu
9d7eef7cf3 Fix datetime field validation for the refactor 2017-04-26 22:45:07 +12:00
Saophalkun Ponlu
4a70662940 Pass html5 flag to front-end 2017-04-26 22:45:07 +12:00
Saophalkun Ponlu
9f8fe88eea Refactor DateTimeField not to use DateField and TimeField 2017-04-26 22:45:07 +12:00
Saophalkun Ponlu
81a21f68cd Add 'lang' attribute to front-end date field schema 2017-04-26 22:45:06 +12:00
Damian Mooyman
0791b387b8 API Update serialisation of JSON tree data
Update TreeDropdownField schema
2017-04-26 17:30:10 +12:00
Saophalkun Ponlu
68041f4265 Wrap selection group input in label 2017-04-26 13:54:06 +12:00
Ingo Schommer
5a7c6d4f60 Allow —no-dev install via a PHPUnit shim
Partially reinstates the 3.x style PhpUnitWrapper which was removed in d1af214ef5.
While we no longer need the full wrapper, the part which creates a fake class is still useful.

The preferred alternative would be to remove any references to SapphireTest from non-dev files,
which mostly applies to SapphireTest::is_running_test(). This should be solved in a larger refactor
of SapphireTest into optional traits and more fine grained functionality.
2017-04-24 15:24:02 +12:00
Simon Erkelens
ff3ad6eb6b Use Config for authenticator settings 2017-04-22 14:48:56 +12:00
Damian Mooyman
c21f71405f Merge pull request #6823 from open-sausages/pulls/4.0/remove-TeamCityListener
Removed TeamCityListener
2017-04-21 15:56:20 +12:00
Ingo Schommer
0a55ff9f8c API Remove SapphireTestReporter and CliTestReporter
Was missed from the removal of PHPUnitWrapper:
a16588aac3

Original reason for this: Don't fail dev/build without phpunit
When you install a SilverStripe project with "composer install --no-dev",
the PHPUnit dependency gets skipped. Which means the PHPUnit_Framework_TestListener
interface doesn't exist. The SilverStripe Classloader might still include
SapphireTestReporter which relies on this interface, which then breaks execution.

SS3 fixed this by NOT defining the class in the first place.
This has been removed in 2fdc96a0de (diff-82b3f89e8e5ae090c93e9c3a2ba8aa36L3),
as part of a PHPUnit version upgrade - but without an apparent fix to replace this.
2017-04-21 15:11:59 +12:00
Ingo Schommer
60e4c011de Removed TeamCityListener 2017-04-21 12:13:13 +12:00
Damian Mooyman
2548bfba1e API Replace SS_HOST with SS_BASE_URL
API Remove Director::$test_servers / $dev_servers
API Remove MODULES_PATH / MODULES_DIR constants
ENHANCEMENT Injector backtick syntax now supports environment variables as well as constants
Fixes #6588
2017-04-20 22:28:57 +12:00
Simon Erkelens
f862ce71d5 Pass the AuthenticationMethod to the controller
Resolves issue #6788
The AuthenticationMethed is passed in via hidden field as per usual, but due to changes, the fallback authenticator was always the MemberAuthenticator and the actual passed in authenticator was defaulting to an empty string.
This causes an issue when there are multiple authenticators and the default authenticator is _not_ in the allowed authenticators, but is still the default. It caused the getAuthenticator method to return the default MemberAuthenticator to be returned, despite it being disabled.
A second issue around multiple authenticators, was the template using a no-longer used method `getAuthenticatorName`. This method returned a null on the default MemberLoginForm (as nothing was set), causing a Warning.
Because the getAuthenticator and getAuthenticatorName are no longer in
use, I've opted to replace these with a translatable string
`getAuthenticatorName`, to
display the title of the form on the tabs, as per the tabset on
Security_MultiAuthenticatorLogin template.
2017-04-18 16:58:15 +12:00
Ingo Schommer
ab54c8e090 Merge pull request #6792 from open-sausages/pulls/4.0/tree-dropdown-react
API major Hierarchy refactor
2017-04-18 08:41:40 +12:00
Simon Erkelens
3f1f9d04b7 Improve the default LoginForm
- has the fields and actions extracted to a separate method, so it's more easily overridable
- Moved the global variable $_REQUEST to getting the info from the controller
- Updated string variables to `::class`
- Updated RequiredFields to be set in the YML, so it's overridable/updatable from either Config or code
2017-04-16 19:05:29 +12:00
Damian Mooyman
136b67f597
API Major refactor of Hierarchy into MarkedSet 2017-04-13 16:27:13 +12:00
Damian Mooyman
f38ae1d837 Cleanup phpdocs on DatetimeField 2017-04-13 14:00:30 +12:00
Damian Mooyman
f2768c85b1 API Enable namespaced-localisation keys in templates
BUG Fix whitespaces in SSTemplateParser.peg
2017-04-11 18:07:53 +12:00
Damian Mooyman
e61257c27b API Update embed/embed to 3.0
API Better shortcode generation for embed shortcodes
2017-04-04 10:20:08 +12:00
Damian Mooyman
9be22701fd API exists() no longer true for nullifyIfEmpty if empty string
Optimise DBString::exists() to skip shortcodes
2017-04-04 10:20:08 +12:00
Christopher Joe
2c5e482de0 Add LabelField component definition 2017-04-04 10:20:08 +12:00
Ingo Schommer
e3fbd1dcac Fixed coding conventions 2017-04-03 20:54:25 +12:00
Ingo Schommer
3b94d14e42 MERGE 2017-04-03 12:11:21 +12:00
Ingo Schommer
326aa37ea4 API HTML5 date/time fields, remove member prefs (fixes #6626) 2017-03-31 15:21:47 +13:00
Ingo Schommer
ac6d4f3038 Move DateField->placeholders to subclass
It’s only used there
2017-03-31 14:15:21 +13:00
Mike Cochrane
227ba8dcc4 FIX illegal_extensions in unit tests not being removed 2017-03-30 13:54:53 +13:00
Sam Minnee
9cdcb339e9 FIX: Fix test breakage in most recent change. 2017-03-30 11:55:43 +13:00
Daniel Hensby
ac075eaf0b Remove TestListener and rely on PHPUnits APIs 2017-03-30 11:46:58 +13:00
Damian Mooyman
ede549a6ed FIX illegalExtensions are optional, requiredExtensions are mandatory with useful error messages. 2017-03-29 11:08:07 +13:00
Damian Mooyman
8c486da3df Merge pull request #6746 from sminnee/underscore-backslash-fix
FIX: Don't mistake \ for _ in dev/build
2017-03-29 10:55:32 +13:00
Damian Mooyman
c2fbb68408 Merge pull request #6748 from robbieaverill/bugfix/config-api-in-fulltextsearchable
FIX Update config API reference in FulltextSearchable and use namespaced imports for class names
2017-03-29 10:51:05 +13:00
Ingo Schommer
ac9d645e4e Root-level module support in Module->getResourcePath()
See https://github.com/silverstripe/silverstripe-framework/pull/6733
2017-03-29 10:19:31 +13:00
Robbie Averill
bd14f6db9e FIX Update config API reference in FulltextSearchable and use namespaced imports for class names 2017-03-29 00:20:39 +13:00
Sam Minnee
59a5eb4308 FIX: Don't mistake \ for _ in dev/build
The query SHOW TABLES LIKE 'some_thing' will match the table some\thing.

This causes issues when the namespace separator has changed.

The fix is to escape the _s in this LIKE statement, as done here.
2017-03-28 18:14:32 +13:00
Ingo Schommer
e08948480c Remove File dependency from Module class 2017-03-28 17:26:23 +13:00
Ingo Schommer
556c9a537e Module->getResourcePath()
Based on Sam's feedback in https://github.com/silverstripe/silverstripe-framework/pull/6733
2017-03-28 17:22:30 +13:00
Damian Mooyman
874c6ccdd4 API Add experimental getResource() to Module 2017-03-28 14:13:47 +13:00
Damian Mooyman
ac3a9c9e6e API Split out SilverStripe\ORM\Versioned into new module 2017-03-27 11:03:39 +13:00
Daniel Hensby
0410b4c35e
Respect PHPUnit method visibility 2017-03-24 16:23:03 +13:00
Damian Mooyman
1186f07830 API Use mysql-safe table namespace separator 2017-03-24 14:17:30 +13:00
Sam Minnée
d91c6659be Merge pull request #6723 from open-sausages/pulls/4.0/assets-module
API Split SilverStripe\Assets into separate module
2017-03-23 09:21:27 +13:00
Damian Mooyman
dae6d5902f API Split SilverStripe\Assets into separate module 2017-03-21 11:12:51 +13:00
Damian Mooyman
e4c68bc2bf
Fix and test pluralisation usages 2017-03-21 10:49:30 +13:00
Sam Minnée
cfa6a36697 Merge pull request #6706 from open-sausages/pulls/4.0/manifest-cache
API Build new ManifestCache based on PSR-16 SimpleCache
2017-03-21 10:29:03 +13:00
Damian Mooyman
3a0099161b API Remove Log class 2017-03-21 09:43:49 +13:00
Damian Mooyman
54ba08a306 API Replace ManifestCache with ManifestCacheFactory
API Remove lots of deprecated module code from ClassManifest
2017-03-21 09:43:48 +13:00
Christopher Joe
6dd236e9b1 remove spaces in elseif statements 2017-03-20 15:39:53 +13:00
Daniel Hensby
3e17dd3201
Move to template PHP syntax for installer 2017-03-16 16:09:46 +13:00
Daniel Hensby
53b98284fe
FIX Remove undefined var from installer 2017-03-16 16:09:33 +13:00
Damian Mooyman
ce14060913 API Apply default logger to all caches
API Rename ‘Logger’ service name to ‘Psr\Log\LoggerInterface’
API DefaultCacheFactory constructor now takes an array of default arguments
2017-03-15 15:31:24 +13:00
Damian Mooyman
8f0f9fa119 API Apply logging to config cache 2017-03-15 15:31:24 +13:00
Ingo Schommer
6b43d79f3e Removed confusing src/ dir 2017-03-15 11:59:13 +13:00
Ingo Schommer
f6a4a059fa Moved frontend code from dist/ to src/
We no longer compile it, so it’s technically the “source” now
2017-03-15 11:07:17 +13:00
Ingo Schommer
02bbc05816 Remove unnecessary frontend build tooling
We’re loading 60MB of node_modules to compile 600 LOC of SCSS files down to CSS.
These can be maintained as plain CSS for now, at least until we redesign installer (at which point we’ll likely split it out into a separate module)
2017-03-15 11:03:04 +13:00
Damian Mooyman
9f953770f5 API Move CMSPreviewable to framework module
Remove or soft-link dependency on admin module
2017-03-14 10:22:45 +13:00
Damian Mooyman
810dcab748 Simplify config for admin removal 2017-03-14 10:22:45 +13:00
Damian Mooyman
a07a9bffc4
API Add FormRequestHandler::forTemplate() for backwards compatibility 2017-03-13 12:51:37 +13:00
Damian Mooyman
0c41a97a8b API Refactor Form request handling into FormRequestHandler
API Add HasRequestHandler interface
API Refactor Link() and url handling behaviour from Controller into RequestHandler
API RequestHandler classes now must define url_segment to have a default Link()
API Clean up redirectBack()
2017-03-10 15:04:33 +13:00
Christopher Joe
466c50b302 API Switch from npm4 and shrinkwrap to npm6 and yarn 2017-03-10 11:38:26 +13:00
Damian Mooyman
63e3fbdccb Remove default scaffold field for DBFile 2017-03-09 13:33:00 +13:00
Christopher Joe
50deb17763 API remove UploadField, AssetField and associated files
Fixes #6481
2017-03-09 10:16:46 +13:00
Daniel Hensby
9c9443602d
FIX Installer no longer causes recursion in yml config 2017-03-07 11:39:11 +00:00
Daniel Hensby
cdb4a86e1c
PHPParser optimisations and update 2017-03-06 10:35:25 +00:00
Loz Calver
f8e3443c89
Initial PHP Parser implementation 2017-03-06 10:19:00 +00:00
Daniel Hensby
f225b83e2b
Merge branch '3' 2017-03-03 15:55:22 +00:00
Daniel Hensby
d01da57da1 Merge pull request #6674 from oilee80/master
Fix for APCu cache otherwise you get 'Cache key must be string, "bool…
2017-03-03 12:17:06 +00:00
Lee Bradley
263e747d07 Fix for APCu cache otherwise you get 'Cache key must be string, "boolean" given'
Also corrects parameter variable name
2017-03-03 10:35:01 +00:00
Damian Mooyman
58f336928a Merge pull request #6672 from andrewandante/FIX/apcu-cache-error
FIX/apcu cache errors
2017-03-03 15:37:50 +13:00
Andrew Aitken-Fincham
abe967f235 FIX/pass arguments directly (not in array) 2017-03-02 11:12:06 +00:00
Damian Mooyman
b6d9b34ce4
BUG Mark $instance as internal to prevent being saved to config 2017-03-02 17:19:44 +13:00