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

merged 2 commits into from Nov 24, 2016


None yet

4 participants

phisch commented Nov 24, 2016 edited


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)


  • 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.


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

@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
@@ -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 Nov 24, 2016 Collaborator



Tested, works 👍

Please fix the tab then this is good to go

@phisch phisch proper indentation
butonic commented Nov 24, 2016



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
continuous-integration/jenkins/pr-head This commit looks good
continuous-integration/travis-ci/pr The Travis CI build passed
licence/cla Contributor License Agreement is signed.
@PVince81 PVince81 deleted the disable-previews branch Nov 24, 2016

@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