diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index 13b505f0f..922fcf050 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -52,8 +52,17 @@ class AdminImagesControllerCore extends AdminController 'stores' => array('title' => $this->l('Stores'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false) ); - // No need to display the old image system if the install has been made later than 2013-03-26 - $this->display_move = (!Configuration::get('PS_LEGACY_IMAGES') && defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true; + // No need to display the old image system migration tool except if product images are in _PS_PROD_IMG_DIR_ + $this->display_move = false; + $dir = _PS_PROD_IMG_DIR_; + if (is_dir($dir)) + if ($dh = opendir($dir)) + { + while (($file = readdir($dh)) !== false && $this->display_move == false) + if (!is_dir($dir.DIRECTORY_SEPARATOR.$file) && $file[0] != '.' && is_numeric($file[0])) + $this->display_move = true; + closedir($dh); + } $this->fields_options = array( 'images' => array(