Index: branches/5.2.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r14753 -r14843 --- branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 14753) +++ branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 14843) @@ -1,6 +1,6 @@ themesFolder . '/'); - /* @var $file_info DirectoryIterator */ + try { + $iterator = new DirectoryIterator($this->themesFolder . '/'); + /* @var $file_info DirectoryIterator */ - foreach ($iterator as $file_info) { - $filename = $file_info->getFilename(); + foreach ($iterator as $file_info) { + $filename = $file_info->getFilename(); - if ( $file_info->isDir() && !$file_info->isDot() && $filename != '.svn' && $filename != 'CVS' ) { - $theme_id = $this->refreshTheme($filename); + if ( $file_info->isDir() && !$file_info->isDot() && $filename != '.svn' && $filename != 'CVS' ) { + $theme_id = $this->refreshTheme($filename); - if ($theme_id) { - $themes_found[] = $theme_id; - // increment serial of updated themes - $this->Application->incrementCacheSerial('theme', $theme_id); + if ( $theme_id ) { + $themes_found[] = $theme_id; + // increment serial of updated themes + $this->Application->incrementCacheSerial('theme', $theme_id); + } } } } + catch ( UnexpectedValueException $e ) { + } $id_field = $this->Application->getUnitOption('theme', 'IDField'); $table_name = $this->Application->getUnitOption('theme', 'TableName'); @@ -510,10 +514,10 @@ }*/ // 2. if none themes found -> delete all from db OR delete all except of found themes - $sql = 'SELECT '.$id_field.' - FROM '.$table_name; - if ($themes_found) { - $sql .= ' WHERE '.$id_field.' NOT IN ('.implode(',', $themes_found).')'; + $sql = 'SELECT ' . $id_field . ' + FROM ' . $table_name; + if ( $themes_found ) { + $sql .= ' WHERE ' . $id_field . ' NOT IN (' . implode(',', $themes_found) . ')'; } $theme_ids = $this->Conn->GetCol($sql); $this->deleteThemes($theme_ids);