silvershop / silvershop-core

SilverShop is an e-commerce shopping cart module for the SilverStripe CMS
http://silvershop.github.io
BSD 2-Clause "Simplified" License
113 stars 119 forks source link

Cannot save new variations with no image #692

Closed aaronballz closed 5 years ago

aaronballz commented 5 years ago

This breaks the admin interface - cannot save new variations with no image as $img will always return true even when no actual file exists! Code should probably be:

$img = $this->Image(); if ($img->exists()) { $img->doPublish(); }

_Originally posted by @devartnz in https://github.com/silvershop/silvershop-core/commit/1e0fdd0f34945316e7f41a5ab73fecb39a9b204b/show_partial#commitcomment-31307214_