Commit Graph

192 Commits

Author SHA1 Message Date
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
Damian Mooyman
6ed98a3a94
BUG Prevent obsolete class cache breaking autoload
Remove hard-coded class paths
2017-03-01 10:06:15 +13:00
Damian Mooyman
e74556b322 API Protect Director::get_environment_type() from invoking 2017-02-28 10:49:29 +13:00
Damian Mooyman
3983b4d1b1 Fix cache used in ModuleManifest 2017-02-27 16:54:01 +13:00
Damian Mooyman
c452d5f6cd API Rename CoreConfigCreator to CoreConfigFactory
Fix rebase regressions
2017-02-27 16:54:01 +13:00
Damian Mooyman
3362e15a29 API Upgrade code to use updated config 2017-02-27 16:54:01 +13:00
Damian Mooyman
3958788858 API Remove Director.environment_type config and replace with static methods 2017-02-27 16:54:01 +13:00
Damian Mooyman
a6e9a7111b API Substitute core config system with new silverstripe/config module 2017-02-27 16:54:01 +13:00
Damian Mooyman
72ddac2a56 API Implement ModuleLoader for module registration by composer name 2017-02-27 16:54:01 +13:00
Damian Mooyman
b3fc11e594
API Move ssmedia plugin to asset-admin 2017-02-27 10:58:41 +13:00
Damian Mooyman
1d49c4afe9 API Remove non-asset-admin TinyMCE media dialog
API Split ssplugin into ssmedia and sslink plugins
2017-02-27 10:38:23 +13:00
Damian Mooyman
bab52e2403 Tweak dropdownfield 2017-02-27 10:38:23 +13:00
Christopher Joe
98ecaf9bd0 Change UploadField to TreeDropdownField for modal fields
Change UploadField to abstract placeholder FileHandleField for non-modal fields
2017-02-27 10:38:23 +13:00
Sam Minnee
f63b741e46 FIX: Improve DebugView’s display of non-header information.
DebugView had not ability just to output a regular paragraph that
didn’t have a blue background.

This refactors the CSS classes a bit to amend this.
2017-02-26 15:07:32 +13:00
Ingo Schommer
cef4ab79a6 Remove debug code 2017-02-26 13:08:02 +13:00
Ingo Schommer
d220ca3f67 API Use symfony/cache (fixes #6252) 2017-02-26 13:07:59 +13:00
Daniel Hensby
7156da6279
Merge branch '3' 2017-02-20 22:19:33 +00:00
Ingo Schommer
d2de4b10e1 Absolute paths for theme lang dirs (fixes #1354)
Regression in 4.x i18n rewrite. Can’t test this since ThemeResourceLoader hardcodes constants like THEME_DIR,
so its impossible to mock in different directory structures. Ideally this would use an application object with access
to environment variables, but that’s too much of a refactor to validate this simple fix.
2017-02-17 16:26:44 +13:00
Ingo Schommer
2805a13cc5 Merge pull request #6607 from open-sausages/pulls/4.0/i18n-locale
API Substitute Zend_Locale / Zend_Date with php-intl
2017-02-16 10:56:13 +13:00
Ingo Schommer
b7bed18192 Mark setShowCalendar() as experimental 2017-02-16 10:55:07 +13:00
Ingo Schommer
80723c077b Reinstated separated DateField functionality 2017-02-16 09:06:14 +13:00
Anselm Christophersen
449ed8d379 Text supports up to 16 megabytes, not 2 (#6368)
See the `requireField` method that defines it as `mediumtext`.
2017-02-15 11:14:41 +13:00
Damian Mooyman
014f0d23ed
API Create SeparatedDateField
API Restrict allowed values parsed via DBDate::setValue
API Remove NumericField_Readonly
API Remove DBTime::Nice12 / Nice24
2017-02-15 11:07:58 +13:00
Damian Mooyman
029a8b9586
API Substitute Zend_Currency with NumberFormatter based solution
API Substitute Zend_Locale with Locale / NumberFormatter
API Substitute Zend_Date with IntlDateFormatter
API Added DBTIme::Nice12, FormatFromSettings
API Added Short() method to DBDate / DBTime / DBDatetime
API Add Date::getTimestamp()
API Added setSubmittedValue api for FormField
API Add second arg to base FormField::setValue()
API Major refactor of i18n into component data parts
API Implement Resettable interface to reset objects between tests
ENHANCEMENT Changed DBField::create_field return type to `static` to support better type hinting
ENHANCEMENT i18nTextCollector supports __CLASS__
2017-02-09 15:28:59 +13:00
Daniel Hensby
71383b827d
Merge branch '3' 2017-02-08 12:34:45 +00:00
Andrew Aitken-Fincham
b8a0944bda FIX/load fields if lazy ones exists 2017-02-08 08:52:48 +00:00
Aaron Carlino
0982f77ec7 Feature/aggregate data filters (#6553) 2017-02-03 09:03:19 +13:00
Damian Mooyman
8d5ff9b2fe Merge pull request #6583 from robbieaverill/bugfix/remove-theme-dir
API Remove ViewableData::ThemeDir, update changelog to reflect suggested replacement
2017-02-02 12:57:20 +13:00
Daniel Hensby
8c8231c03e
NEW Director::host() to determine host name of site 2017-01-31 21:36:04 +00:00
Daniel Hensby
873fd8c5bc
NEW replace _ss_environment.php with .env and environment vars 2017-01-31 20:40:17 +00:00
Daniel Hensby
a5da085cc7
Merge branch '3' 2017-01-31 17:03:53 +00:00
Daniel Hensby
efb5c5bfe9 Merge pull request #6567 from open-sausages/pulls/4.0/flush-tests
BUG Ensure that tests run with flush=1 clean Flushables
2017-01-31 11:36:07 +00:00
Damian Mooyman
7b26b4a1f3 BUG Ensure that tests run with flush=1 clean Flushables
BUG Restore opt-in flushing (regression from #4404)
2017-01-31 18:59:19 +13:00
Robbie Averill
9d35ff8f95 API Remove ViewableData::ThemeDir, update changelog to reflect suggested replacement 2017-01-31 10:56:52 +13:00
Robbie Averill
232b218dfb FIX Ensure that Zend_ classes can still be autoloaded 2017-01-30 11:12:24 +13:00
Daniel Hensby
77bfea1197 Merge pull request #6564 from Quadra-Digital/dbfield-setter-improvements
ENHANCEMENT: DBField 'setter' methods return instance of themselves
2017-01-28 09:23:39 +00:00
Loz Calver
d3c24769ac Merge pull request #6469 from dhensby/pulls/4/image-backend-interface
FIX Make sure image backends implement method getImageResource
2017-01-27 16:59:46 +00:00
Daniel Hensby
a282b3f420 Merge pull request #6528 from zacps/3310-permissions
Simplify permissions displayed when admin (fixes #3310)
2017-01-27 10:26:12 +00:00
Colin Tucker
34398b0faa Cast SmallFieldHolder to HTMLFragment - fixes #6568 2017-01-27 09:16:58 +11:00
Daniel Hensby
c81959cce0 Merge pull request #6558 from open-sausages/pulls/4.0/i18n-symfony
API Replace i18n message localisation with symfony/translation
2017-01-26 13:11:59 +00:00
Damian Mooyman
de02a3f733
Restored context parameter to i18n, and added to a “comment” key
Rolled pluralisation functionality into the i18n::_t() method
Warnings on missing default can now be turned off
2017-01-25 18:12:40 +13:00
Damian Mooyman
8a07c56bdf API Replace i18n message localisation with symfony/translation
API Implement enhanced pluralisation
Remove Zend_Translate and all Zend dependencies from i18n
Deprecated $context from i18n::_t()
Warn on missing default string for i18n::_t()
2017-01-25 17:08:12 +13:00
Damian Mooyman
5d6c90361c
BUG Ensure root path of any local adapter is safely created and mapped from symlink
Fixes https://github.com/silverstripe/silverstripe-asset-admin/issues/362
2017-01-25 13:55:02 +13:00
Joe Harvey
daeb3d7abf Updating all setter methods on DBMoney to return an instance of themselves 2017-01-24 15:57:02 +00:00
Joe Harvey
38e86f04d8 Updating all setter methods on DBField to return an instance of themselves 2017-01-24 15:56:51 +00:00
Joe Harvey
3633d6e27f Updating all setter methods on DBDate to return an instance of themselves 2017-01-24 15:56:45 +00:00
Zac Pullar-Strecker
a0d01542a6 Remove examples of Log::::add_writer() (fixes #6346)
Log::add_writer() has been removed in SilverStripe 4.0.0.
2017-01-20 12:27:54 +13:00
Zac Pullar-Strecker
720e2045c9 Simplify permissions displayed when admin (fixes #3310)
This changes permissions inherited by being a superuser to gray,
instead of the red x that made it look like you didn't have it.
2017-01-18 14:01:44 +13:00
Daniel Hensby
8b4cce435e
Merge branch '3' 2017-01-17 14:17:45 +00:00
Lee Bradley
6000e3ba16 GridFieldAddExistingAutocompleter: Make Search Response HTTPResponse
Also adds the 'text/json' Content-Type header
2017-01-17 10:03:07 +00:00
Damian Mooyman
d192a4f86f BUG Fix root folder getFilename() returning incorrect path (#6510) 2017-01-17 17:49:42 +13:00
Damian Mooyman
87ac3e3971 ENHANCEMENT Display warning on always_populate_raw_post_data not being -1 in php 5 (#6507) 2017-01-16 17:31:48 +13:00
Damian Mooyman
7d67c5b9bd
API Allow users to act-as another 2017-01-16 09:04:20 +13:00
Daniel Hensby
c4972da37e Merge pull request #6496 from robbieaverill/feature/remove-gridfield-components
API Enhancement: Allow "removeComponentsByType" to remove multiple component"s"
2017-01-13 11:29:04 +00:00
Robbie Averill
ce38f1f1fd API Enhancement: Allow "removeComponentsByType" to remove multiple component"s" 2017-01-13 23:30:30 +13:00
Loz Calver
b64b4497ca Merge pull request #6492 from open-sausages/pulls/4.0/security-page-class
API Shift Security page class config to separate option
2017-01-13 09:18:14 +00:00
Daniel Hensby
3ea5015f8b NEW Move to SwiftMailer powered Emails (#6466)
* API Replace existing Email and Mailer classes with SwiftMailer powered email system

* DOCS New Email docs

* Initial feedback from Damian

* Making Mailer an interface

* Templates relocated

* Round of feedback

* More robust approach to plain parts

* Revert changes to TestMailer
2017-01-13 14:48:46 +13:00
Damian Mooyman
e6ae532998 Merge pull request #6484 from open-sausages/pulls/unique-folder-enforced
Enforce unique Folder names, use AssetNameGenerator
2017-01-13 13:54:51 +13:00
Damian Mooyman
1049b710fe Merge pull request #6487 from robbieaverill/bugfix/remapping-versioned-classnames
FIX Remap versioned ClassNames during build process
2017-01-13 12:05:22 +13:00
Robbie Averill
9559cb2eda Handle Versioned implementations that do not have stages 2017-01-13 11:29:48 +13:00
Ingo Schommer
3b06e30558 Don’t add extension dot in FileNameFilter
File names are generally valid without an extension (although they might be disallowed by upload constraints),
so the filter should deal gracefully with them (“myfile” should return “myfile”, not “myfile.”)
2017-01-13 11:11:40 +13:00
Ingo Schommer
b1d5e97a3d Enforce unique Folder names, use AssetNameGenerator 2017-01-13 11:11:37 +13:00
Damian Mooyman
2c274c838e
API Shift Security page class config to separate option 2017-01-13 09:16:13 +13:00
Damian Mooyman
3f1cda8510 Merge pull request #6491 from kinglozzer/mysqlquery-seek
FIX: MySQLQuery::seek() failed to return a row
2017-01-13 09:06:53 +13:00
Loz Calver
30d125f144 FIX: MySQLQuery::seek() failed to return a row 2017-01-12 15:34:28 +00:00
Loz Calver
3e95fc51f7 Merge pull request #6490 from colintucker/fix-empty-db-installer-bug
Check if $database is empty before adding prefix/suffix
2017-01-12 09:31:29 +00:00
Colin Tucker
d4db1f5189 Check if $database is empty before adding prefix/suffix 2017-01-12 11:24:33 +11:00
Robbie Averill
a4bc9f49d1 FIX Regression in using template_main to render the Security area
* Introduced in 0cf477d36
* Should use the "template_main" static to decide which model to use for rendering this page
* Assuming SiteTree means any requirements added in Page and assumed to work everywhere will not
2017-01-12 13:11:40 +13:00
Robbie Averill
2d1d2aea79 FIX Remap versioned ClassNames during build process 2017-01-12 12:15:21 +13:00
Sam Minnee
6fc50cae5c FIX: Refactor TestMailer to better be base class
This small refactoring makes TestMailer better suited as a base class
for the behat-extension’s implementation, which means that we don’t
need to coordinate cross-module commits in dhensby’ SwiftMailer work.

See https://github.com/silverstripe/silverstripe-framework/pull/6466
2017-01-12 10:22:57 +13:00
Daniel Hensby
747c0770e7 Merge pull request #6446 from robbieaverill/feature/controllers-without-underscores
API Allow controller discovery without underscores (PSR-2 compliance)
2017-01-11 15:27:56 +00:00
Damian Mooyman
b52a963ed7
ENHANCEMENT Remove jquery-ui button() api from default HTML editor dialog 2017-01-11 17:04:20 +13:00
Robbie Averill
e4f67f6e2c Add extra backslashes and ungreedy modifier 2017-01-11 14:49:09 +13:00
Damian Mooyman
6b5efb91fd Merge pull request #6434 from open-sausages/features/4.0/ui-button-refresh
Refresh CMS UI buttons to new flat style and bootstrap classes
2017-01-11 14:22:25 +13:00
Robbie Averill
62eb0e6142 FIX Rename template parser from .inc to .peg so PHP doesn't include it automatically 2017-01-11 12:36:08 +13:00
Damian Mooyman
d9034f5bfc
Remove redundant CMSSecurity.js dist file
Cleanup GridFieldFilterHeader / GridFieldSortableHeader
2017-01-11 12:00:01 +13:00
Robbie Averill
6fb49224b9 FIX SSViewer should resolve templates with or without underscores
* Capture fully qualified class name, without "Controller"
2017-01-11 09:59:28 +13:00
Robbie Averill
c620063608 DOCS Update docs to reference PageController without an underscore, implement some PSR-2 2017-01-11 09:59:28 +13:00
Daniel Hensby
a996e20e79 Merge pull request #6450 from mikenz/page-to-sitetree
ENHANCEMENT: Use SiteTree instead of Page class in more places
2017-01-10 16:02:15 +00:00
Daniel Hensby
8badad90df
FIX Make sure image backends implement method getImageResource 2017-01-10 15:15:51 +00:00
Daniel Hensby
f3b6bb1470
Merge branch '3' 2017-01-10 14:31:07 +00:00
Damian Mooyman
b62f9b60a0
BUG Fix broken member / group import
BUG GridFieldImportButton no longer only works on ModelAdmin
2017-01-10 17:57:54 +13:00
Christopher Joe
8118448a9c Fix PHP linting issues 2017-01-10 11:34:50 +13:00
Will Rossiter
56c2363909 Implement feedback fixes
Enhancement Fix ModelAdmin import form not POSTing to correct form
2017-01-10 11:05:58 +13:00
Paul Clarke
e893fc4c51 Enhancement improve secondary action colours
Enhancement add accessibility info to page number
Enhancement new font icons added, improve trash icon and increase icon size of close
Enhancement improve title of gridfield search trigger
Enhancement add title to button to open gridfield search and improve gridfield search styles
API Shortcode fails if no parent
API JQuery-UI classes removed
Enhancement centre actions tabs within dropup in more-actions
Enhancement fix IE input height issue and fix for safari of icons in buttons with hidden text (e.g. pagination)
Enhancement only show external link on hover
2017-01-10 10:55:34 +13:00
Will Rossiter
ddc9a9c6d6 Enhancement Fix up buttons within gridfield search
Enhancement Fix up batch actions button
2017-01-10 10:53:10 +13:00
Paul Clarke
7b90ee137d Enhancement resize icon to sit inline and increase size of search icon and Upload icon
Enhancement remove float from buttons as already aligned inline
Enhancement Align buttons in toolbar more consistently
API remove ui overrides
API ss-ui-button no longer exists so styles where not seen, removed nesting
2017-01-10 10:51:07 +13:00
Will Rossiter
cb6ec11f1b Enhancement Implement import CSV icon and tidy up import forms
Enhancement Tidy up permission icons to new icon library
WIP The modal is a short term workaround until the UI is all react based but we wanted to do some cleanup prior to 4 release
API Remove ssui.button
Enhancement Update buttons to new flat bootstrap style
2017-01-10 10:49:15 +13:00
Paul Clarke
178bd480eb API Changes required for asset search behaviour 2017-01-09 14:55:20 +13:00
Ingo Schommer
3b50506aa0 Fail manipulateImage() without image resource
Sometimes a manipulation can’t be carried out, either because the backend isn’t available,
or because there isn’t enough PHP memory available. In these cases, $backend->getImageResource()
will be set to NULL. This should be picked up by manipulateImage(), to avoid passing an invalid
backend into the $callback provided.

The specific case this solves is calling Image->FitMax() on large images:
$resizedImage = $originalImage->FitMax(<width>, <height>)
This will have $resizedImage==$originalImage if the image is smaller than the targeted dimensions,
but with this fix $resizedImage==NULL if the image is too large to be resized.
Which gives custom code the ability to determine which of the two should be used,
for example choosing not to pass the original large image URL to the client
since it wouldn’t be considered a “thumbnail” size.
2017-01-06 18:45:56 +13:00
Ingo Schommer
fcb511b1c0 Reinstated GDBackend->checkAvailableMemory()
This was removed as part of the SS4 assets refactor:
be239896d3
Presumably @tractorcow didn’t feel it’s possible to retain this,
because we don’t have local file handles required for getimagesize().
Since there’s getimagesizefromstring() as well (added in PHP 5.4),
we just needed a different logic branch.

Also makes the logic more resilient against missing GD resources on a backend.
Lack of available memory for a resize is only one (new) reason,
other edge cases were already causing these missing resources (e.g. an invalid file string).

Original discussion: https://groups.google.com/forum/m/#!topic/silverstripe-dev/B57a3KYeAVQ
Pull request for 3.x: https://github.com/silverstripe/silverstripe-framework/pull/2859
More context: https://github.com/silverstripe/silverstripe-framework/pull/2569
2017-01-06 18:45:56 +13:00
Ingo Schommer
6e561f00bd Force GC in GDBackend
This has been discussed previously, and was assumed to be handled by PHP automatically:
https://github.com/silverstripe/silverstripe-framework/issues/2739#issuecomment-32603005
It’s unclear if its a regression in SS4.

Tested with PHP 5.6.29, by setting xdebug breakpoints
and inspecting memory_get_usage() before and after GDBackend->manipulateImage().
Even a single 7MB JPEG straight from my DSLR (6000x300) can chomp bring the system from 30MB to >128MB memory use.
That’s in addition to the 7MB of PHP memory required for the $content variable.
Note that the image manipulations likely happen on the raw bitmap, which is much larger than the 7MB compressed JPEG.

Checked ImagickBackend, which doesn’t have this issue (and only uses about half the memory for the same set of images).
2017-01-06 18:45:56 +13:00
Daniel Hensby
9ee3be9337 Merge pull request #6449 from mikenz/show-query-number
ENHANCEMENT: Show the query count/query number when using showqueries
2017-01-03 12:04:47 +00:00
Mike Cochrane
0cf477d36e Use SiteTree instead of Page class in more places 2017-01-03 20:37:17 +13:00
Mike Cochrane
90fec4b8e7 Show the query count/query number when using showqueries 2017-01-03 18:13:44 +13:00
Mike Cochrane
b43f2d57c2 Add mising use statements for showqueries=inline to work 2017-01-03 18:04:11 +13:00
Robbie Averill
6f4162ed74 FIX PHP 7.x should use random_bytes for entropy ahead of deprecated mcrypt lib 2016-12-29 23:46:08 +13:00
Robbie Averill
37a009289c Consolidate temporary file creation and deletion logic. 2016-12-29 22:32:04 +13:00