From aad36c9329361c4a2afb7d1b5e511dbd75c42307 Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Wed, 16 Dec 2015 11:11:48 +0100 Subject: [PATCH] Use assetSources service for asset field model --- src/models/AssetsField.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/models/AssetsField.php b/src/models/AssetsField.php index 75fe540b..58479bfd 100644 --- a/src/models/AssetsField.php +++ b/src/models/AssetsField.php @@ -31,11 +31,11 @@ public function getDefinition(FieldModel $field, $includeContext) $settings = $definition['settings']; $defaultUploadLocationSourceId = $settings['defaultUploadLocationSource']; - $defaultUploadLocationSource = Craft::app()->schematic_assets->getSourceTypeById($defaultUploadLocationSourceId); + $defaultUploadLocationSource = Craft::app()->schematic_assetSources->getSourceTypeById($defaultUploadLocationSourceId); $settings['defaultUploadLocationSource'] = $defaultUploadLocationSource ? $defaultUploadLocationSource->handle : ''; $singleUploadLocationSourceId = $settings['singleUploadLocationSource']; - $singleUploadLocationSource = Craft::app()->schematic_assets->getSourceTypeById($singleUploadLocationSourceId); + $singleUploadLocationSource = Craft::app()->schematic_assetSources->getSourceTypeById($singleUploadLocationSourceId); $settings['singleUploadLocationSource'] = $singleUploadLocationSource ? $singleUploadLocationSource->handle : ''; $definition['settings'] = $settings; @@ -55,11 +55,11 @@ public function populate(array $fieldDefinition, FieldModel $field, $fieldHandle $settings = $fieldDefinition['settings']; $defaultUploadLocationSourceId = $settings['defaultUploadLocationSource']; - $defaultUploadLocationSource = Craft::app()->schematic_assets->getSourceTypeByHandle($defaultUploadLocationSourceId); + $defaultUploadLocationSource = Craft::app()->schematic_assetSources->getSourceTypeByHandle($defaultUploadLocationSourceId); $settings['defaultUploadLocationSource'] = $defaultUploadLocationSource ? $defaultUploadLocationSource->id : ''; $singleUploadLocationSourceId = $settings['singleUploadLocationSource']; - $singleUploadLocationSource = Craft::app()->schematic_assets->getSourceTypeByHandle($singleUploadLocationSourceId); + $singleUploadLocationSource = Craft::app()->schematic_assetSources->getSourceTypeByHandle($singleUploadLocationSourceId); $settings['singleUploadLocationSource'] = $singleUploadLocationSource ? $singleUploadLocationSource->id : ''; $field->settings = $settings;