Skip to content

Commit

Permalink
Fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
amercier committed Aug 8, 2013
1 parent fa877ba commit 6f85d67
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ with the exception of the following additions and changes:
✔ Fixed [#5](https://github.com/amercier/vmware-vcloud-sdk-php-patched/issues/5): Edge gateway modification doesn't work
✔ Fixed [#6](https://github.com/amercier/vmware-vcloud-sdk-php-patched/issues/6): Uploading big OVF files doesn't work
✔ Fixed [#7](https://github.com/amercier/vmware-vcloud-sdk-php-patched/issues/7): Uploading OVF files doesn't work on Windows/Cygwin
✔ Fixed [#8](https://github.com/amercier/vmware-vcloud-sdk-php-patched/issues/8): Set image type in VMWare_VCloud_SDK_Vdc::uploadMedia


Versioning
Expand Down
6 changes: 2 additions & 4 deletions library/VMware/VCloud/SDK/Vdc.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ private function getMediaUploadInfo($media)
*/
private function uploadMedia($filename, $imageType, $mediaType)
{
$mediaType->set_imageType($imageType);
$mediaUpInfo = $this->sendUploadMediaRequest($mediaType);
$url = $this->getMediaUploadInfo($mediaUpInfo);
$durl = $mediaUpInfo->get_href();
Expand Down Expand Up @@ -624,7 +625,4 @@ public function getVdcStorageProfileRefs($name=null)
*/
public function getVdcStorageProfiles($name=null)
{
$refs = $this->getVdcStorageProfileRefs($name);
return $this->getObjsByContainedRefs($refs);
}
}
$
15 changes: 15 additions & 0 deletions scripts/patches/008-upload-media-type.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
library/VMware/VCloud/SDK/Vdc.php | 1 +
1 file changed, 1 insertion(+)

diff --git a/library/VMware/VCloud/SDK/Vdc.php b/library/VMware/VCloud/SDK/Vdc.php
index 70180f6..1ae58e6 100644
--- a/library/VMware/VCloud/SDK/Vdc.php
+++ b/library/VMware/VCloud/SDK/Vdc.php
@@ -398,6 +398,7 @@ $vdcStorageProfileRef, $catalogRef)
*/
private function uploadMedia($filename, $imageType, $mediaType)
{
+ $mediaType->set_imageType($imageType);
$mediaUpInfo = $this->sendUploadMediaRequest($mediaType);
$url = $this->getMediaUploadInfo($mediaUpInfo);
$durl = $mediaUpInfo->get_href();

0 comments on commit 6f85d67

Please sign in to comment.