Fixed removing image when saving preferences with no upload

This commit is contained in:
Duncan Sommerville 2015-03-02 14:57:50 -05:00
parent 78c7170c4e
commit 13bd0b7589
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ class PreferenceController extends Zend_Controller_Action
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
$logoUploadElement->receive();
$imagePath = $logoUploadElement->getFileName();
// Only update the image logo if the new logo is non-empty
if (!is_null($imagePath) && $imagePath != "") {
Application_Model_Preference::SetStationLogo($imagePath);
}
Application_Model_Preference::SetEnableSystemEmail($values["enableSystemEmail"]);
Application_Model_Preference::SetSystemEmail($values["systemEmail"]);