Skip to content

Commit

Permalink
Update for config rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Feb 22, 2017
1 parent 7bf6f91 commit 2933a4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions code/Controller/AssetAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,8 @@ public function getObjectFromData(File $file)
/** @var File $file */
if ($file->getIsImage()) {
// Small thumbnail
$smallWidth = UploadField::config()->get('thumbnail_width');
$smallHeight = UploadField::config()->get('thumbnail_height');
$smallWidth = UploadField::config()->uninherited('thumbnail_width');
$smallHeight = UploadField::config()->uninherited('thumbnail_height');
$smallThumbnail = $file->FitMax($smallWidth, $smallHeight);
if ($smallThumbnail && $smallThumbnail->exists()) {
$object['smallThumbnail'] = $smallThumbnail->getAbsoluteURL();
Expand Down Expand Up @@ -1014,7 +1014,7 @@ protected function getUpload()
$upload = Upload::create();
$upload->getValidator()->setAllowedExtensions(
// filter out '' since this would be a regex problem on JS end
array_filter(File::config()->get('allowed_extensions'))
array_filter(File::config()->uninherited('allowed_extensions'))
);

return $upload;
Expand Down
8 changes: 4 additions & 4 deletions code/GraphQL/FileTypeCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ public function resolveSmallThumbnailField($object, array $args, $context, $info
}

// Small thumbnail
$smallWidth = UploadField::config()->get('thumbnail_width');
$smallHeight = UploadField::config()->get('thumbnail_height');
$smallWidth = UploadField::config()->uninherited('thumbnail_width');
$smallHeight = UploadField::config()->uninherited('thumbnail_height');
$smallThumbnail = $object->FitMax($smallWidth, $smallHeight);
if ($smallThumbnail && $smallThumbnail->exists()) {
return $smallThumbnail->getAbsoluteURL();
Expand All @@ -188,8 +188,8 @@ public function resolveThumbnailField($object, array $args, $context, $info)
}

// Large thumbnail
$width = AssetAdmin::config()->get('thumbnail_width');
$height = AssetAdmin::config()->get('thumbnail_height');
$width = AssetAdmin::config()->uninherited('thumbnail_width');
$height = AssetAdmin::config()->uninherited('thumbnail_height');
$thumbnail = $object->FitMax($width, $height);
if ($thumbnail && $thumbnail->exists()) {
return $thumbnail->getAbsoluteURL();
Expand Down

0 comments on commit 2933a4d

Please sign in to comment.