Commit Graph

17646 Commits

Author SHA1 Message Date
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
Daniel Hensby
733511565e
Merge branch '3.5' into 3 2017-01-10 12:52:06 +00:00
Lee Bradley
87fbd5f781 Fix for v4: Admin returns "Too many pages" for subpages below top level (#6464)
* Fix for v4: Admin returns "Too many pages" for subpages below top level

Simple logic error during porting to new version it appears

* V4: LeftAndMain::getSiteTreeFor() returning space & New line in link

The "Too many pages" "View as list" link had a return &
  tab characters in it

* V4: LeftAndMain::getSiteTreeFor() fixes link for list view

"Too many pages" link pointed to `?view=list` which is
  just normal hierarchy. Value had been updated to "listview"
  in #8c87ea6b
2017-01-09 12:45:03 +00:00
Ingo Schommer
c2bc0df92a Fail buids on linting errors
Silently failing only the first command with error code 0 through a single ampersand
is hardly intuitive. Our general line is that either you have linting and
enforce it (via build failures), or you might as well not bother since
it'll deteriorate quickly.
2017-01-09 23:46:28 +13:00
Ingo Schommer
3b4b35115a Merge pull request #6389 from open-sausages/pulls/4.0/asset-admin-search
Asset search
2017-01-09 22:22:21 +13:00
Damian Mooyman
c183324bcd Merge pull request #6461 from open-sausages/pulls/3/clarify-dataobject-record-constructor
Clarify DataObject::__construct()
2017-01-09 17:46:17 +13:00
Ingo Schommer
e55554d087 Clarify DataObject::__construct()
The $record argument should NOT be used for object construction, since it bypasses setters.
While the original PHPDoc hints at this (“internal systems”), it doesn’t make it clear enough.
2017-01-09 17:02:41 +13:00
Christopher Joe
cdd86aaf53 Fix breadcrumbs search results text sometimes disappearing 2017-01-09 14:55:20 +13:00
Ingo Schommer
07f0527ede Updated dist files 2017-01-09 14:55:20 +13:00
Ingo Schommer
f755c393a4 Removed unnecessary urlQuery(), expose qs instead
The asset-admin module uses a simpler algo now
2017-01-09 14:55:20 +13:00
Ingo Schommer
9e8e6314da Changed capitalisation of search filter names 2017-01-09 14:55:20 +13:00
Ingo Schommer
8981861c76 DataFormat unit tests 2017-01-09 14:55:20 +13:00
Ingo Schommer
b06e10c4a8 i18n for new template strings 2017-01-09 14:55:20 +13:00
Paul Clarke
178bd480eb API Changes required for asset search behaviour 2017-01-09 14:55:20 +13:00
Damian Mooyman
c601b7d384 Merge pull request #6455 from robbieaverill/patch-4
DOCS Change "Injector" to "SilverStripe\Core\Injector\Injector" in Logger examples
2017-01-09 12:27:28 +13:00
Damian Mooyman
a39ae49c57 Merge pull request #6458 from open-sausages/pulls/4.0/asset-memory-use
Fix memory leaks in image manipulation
2017-01-09 11:32:36 +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
Robbie Averill
47ab244f0a DOCS Change "Injector" to "SilverStripe\Core\Injector\Injector" in Logger examples 2017-01-06 14:37:27 +13:00
Damian Mooyman
3e32b18c6b Merge pull request #6263 from dhensby/pulls/3/allow-unltd-grid-row-count
NEW Allow setting of unlimited row counts on GridFieldPaginator
2017-01-05 09:12:02 +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
Daniel Hensby
6ce4cc0ba1 Merge pull request #6448 from mikenz/fix-showqueries-inline
FIX: Add mising use statements for ?showqueries=inline to work
2017-01-03 10:48:46 +00: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
Daniel Hensby
6d8defcc1e Merge pull request #6445 from robbieaverill/bugfix/upgrader-mappings
FIX Correct namespaes for test classes in upgrade.yml
2016-12-29 23:42:50 +00:00
Daniel Hensby
faccdef532 Merge pull request #6444 from robbieaverill/feature/add-group-tests
TEST Add Group tests for collating family IDs and getting all children
2016-12-29 23:41:31 +00:00
Robbie Averill
b4e183aba5
TEST Add Group tests for collating family IDs and getting all children 2016-12-30 11:27:52 +13:00
Robbie Averill
d41ebbaaff FIX Correct namespaes for test classes in upgrade.yml 2016-12-30 11:25:34 +13:00
Daniel Hensby
776d2fbc66
NEW Allow setting of unlimited row counts on GridFieldPaginator 2016-12-29 14:10:13 +00:00
Daniel Hensby
fe3f9ddf51 Merge pull request #6443 from robbieaverill/feature/historical-password-count-test
TEST Add historical password count test
2016-12-29 13:00:49 +00:00
Robbie Averill
e8b959864e TEST Add historical password count test 2016-12-30 00:43:14 +13:00
Daniel Hensby
8bc7cae1e2 Merge pull request #6442 from robbieaverill/bugfix/php-7.1-tweaks
PHP 7.1 compatibility tweaks
2016-12-29 11:39:24 +00: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
088d4ff222 Add PHP 7.1 to Travis configuration. Switch 7.0 to test only, 7.1 to coverage 2016-12-29 22:59:16 +13:00
Robbie Averill
37a009289c Consolidate temporary file creation and deletion logic. 2016-12-29 22:32:04 +13:00
Robbie Averill
7448622a1a FIX Replace ini casting to int with explicit split and cast for PHP 7.1. Add tests. 2016-12-29 21:55:52 +13:00
Daniel Hensby
664c0eafbe
Merge branch '3' 2016-12-28 14:30:54 +00:00
Daniel Hensby
c8a40605ec Merge pull request #6413 from volkerloew/1400-text-contextsummary
search term highlighting without altering case (fixes #1400)
2016-12-28 13:36:08 +00:00
Volker Löw
5e581eace7
search term highlighting without altering case (fixes #1400) 2016-12-28 13:03:35 +00:00
Daniel Hensby
1b1f8ed731
Merge branch '3.5' into 3 2016-12-28 11:37:10 +00:00
Daniel Hensby
054cbaa219 Merge pull request #6437 from open-sausages/pulls/4.0/update-apollo-client
Updated apollo-client
2016-12-28 11:32:13 +00:00
Damian Mooyman
a9b7a489d1 Merge 3.5 into 3 2016-12-22 13:19:08 +13:00
Damian Mooyman
b1b3a6ee13 Merge 3.4 into 3.5 2016-12-22 13:18:37 +13:00
Damian Mooyman
0bcd40545d Merge 3.5.1 into 3.5 2016-12-22 13:17:18 +13:00
Damian Mooyman
94c3bc9fa1 Merge 3.4.3 into 3.4 2016-12-22 13:16:12 +13:00
Damian Mooyman
28d065c587 Added 3.4.3 changelog 2016-12-22 12:02:45 +13:00
Ingo Schommer
120bcee4f8 Updated apollo-client 2016-12-22 11:26:44 +13:00
Damian Mooyman
9de539fdab Added 3.5.1 changelog 2016-12-22 10:43:34 +13:00