Skip to content

Commit

Permalink
Fix notice in ThemeConfiguration on file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
zerocrates committed Aug 10, 2023
1 parent 064f1be commit cab121d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions application/controllers/helpers/ThemeConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ private function _processFileElement(Zend_Form_Element_File $element)
*/
private function _deleteOldFile(Zend_Form_Element_File $element)
{
// delete old file if it is not the same as the new file name
if (!isset($this->_themeOptions[$element->getName()])) {
$elementName = $element->getName();

if (!isset($this->_themeOptions[$elementName])) {
return;
}
$oldFileName = $this->_themeOptions[$element->getName()];
$oldFileName = $this->_themeOptions[$elementName];
$newFileName = $this->_formValues[$elementName];

// delete old file if it is not the same as the new file name
if ($oldFileName != $newFileName) {
$storage = Zend_Registry::get('storage');
$storagePath = $storage->getPathByType($oldFileName, self::THEME_UPLOAD_TYPE);
Expand Down

0 comments on commit cab121d

Please sign in to comment.