Don't fetch preview images if `enable_previews` is set to `false` #26705

Merged
merged 2 commits into from Nov 24, 2016

Projects

None yet

4 participants

@phisch
Contributor
phisch commented Nov 24, 2016 edited

Description

Even if enable_previews in config/config.php has been set to false, the file-list and detail-view both still try to get a preview image. The lazyLoadPreview method now checks for this configuration and only renders the default mime-icons now if previews have been disabled through the configuration.

Motivation and Context

See description.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@felixheidecke

@phisch phisch don't try to render preview images if 'enable_previews' has been set …
…to false
e3790f0
@mention-bot

@PhilippSchaffrath, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rullzer, @icewind1991 and @PVince81 to be potential reviewers.

@phisch phisch added this to the 9.2 milestone Nov 24, 2016
core/js/config.php
@@ -167,7 +167,8 @@
'resharingAllowed' => \OCP\Share::isResharingAllowed(),
'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated'),
- 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing()
+ 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing(),
+ 'previewsEnabled' => \OC::$server->getConfig()->getSystemValue('enable_previews', true) === true,
@PVince81
PVince81 Nov 24, 2016 Collaborator

tabs

@PVince81

Tested, works 👍

Please fix the tab then this is good to go

@phisch phisch proper indentation
0b64e00
@butonic
Member
butonic commented Nov 24, 2016

👍

@PVince81
Collaborator

I suggest we also backport this to 9.1, 9.0, seems this never worked correctly.

@PVince81 PVince81 merged commit 7936423 into master Nov 24, 2016

4 checks passed

Scrutinizer 46 new issues, 308 updated code elements
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
@PVince81 PVince81 deleted the disable-previews branch Nov 24, 2016
@PVince81
Collaborator

@PhilippSchaffrath please submit backport PRs for 9.1 and 9.0, thanks

@phisch phisch was assigned by PVince81 Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment