Skip to content

Commit

Permalink
Merge pull request #101 from webbuilders-group/thumbnail_path_fix
Browse files Browse the repository at this point in the history
FIX: Thumbnail path and file class reference issue
  • Loading branch information
Aaron Carlino authored May 10, 2021
2 parents 5cec6fb + d4d39eb commit 7058ff8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DropzoneFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getPreviewThumbnail($w = null, $h = null)
*/
protected function getFilenameForType($ext, $size)
{
return ModuleResourceLoader::singleton()->resolveResource(sprintf(
return ModuleResourceLoader::singleton()->resolveURL(sprintf(
'unclecheese/dropzone:images/file-icons/%spx/%s.png',
$size,
strtolower($ext)
Expand Down
2 changes: 1 addition & 1 deletion src/FileAttachmentField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ public function AttachedFiles()
public function RootThumbnailsDir()
{
return $this->getSetting('thumbnailsDir') ?:
ModuleResourceLoader::singleton()->resolveResource('unclecheese/dropzone:images/file-icons');
ModuleResourceLoader::singleton()->resolveURL('unclecheese/dropzone:images/file-icons');
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/FileAttachmentFieldTrack.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UncleCheese\Dropzone;

use SilverStripe\Assets\File;
use SilverStripe\Control\Controller;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DataObjectInterface;
Expand All @@ -20,7 +21,7 @@ class FileAttachmentFieldTrack extends DataObject
);

private static $has_one = array(
'File' => 'File',
'File' => File::class,
);

private static $table_name = 'FileAttachmentFieldTrack';
Expand Down

0 comments on commit 7058ff8

Please sign in to comment.