Commit Graph

92 Commits

Author SHA1 Message Date
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
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
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