瀏覽代碼

FIX Rename of image file lose the thumbs

Laurent Destailleur 6 年之前
父節點
當前提交
48162db33d
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 5 2
      htdocs/core/actions_linkedfiles.inc.php
  2. 1 0
      htdocs/langs/en_US/admin.lang

+ 5 - 2
htdocs/core/actions_linkedfiles.inc.php

@@ -217,11 +217,14 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha'))
 			            {
 			            	// Define if we have to generate thumbs or not
 			            	$generatethumbs = 1;
-			            	if (GETPOST('section_dir')) $generatethumbs=0;
+			            	// When we rename a file from the file manager in ecm, we must not regenerate thumbs (not a problem, we do pass here)
+			            	// When we rename a file from the website module, we must not regenerate thumbs (module = medias in such a case)
+			            	// but when we rename from a tab "Documents", we must regenerate thumbs
+			            	if (GETPOST('modulepart') == 'medias') $generatethumbs=0;
 
 			            	if ($generatethumbs)
 			            	{
-				            	if ($object->id)
+			            		if ($object->id)
 				            	{
 				                	$object->addThumbs($destpath);
 				            	}

+ 1 - 0
htdocs/langs/en_US/admin.lang

@@ -1845,6 +1845,7 @@ WithDolTrackingID=Dolibarr Tracking ID found
 WithoutDolTrackingID=Dolibarr Tracking ID not found
 FormatZip=Zip
 MainMenuCode=Menu entry code (mainmenu)
+ECMAutoTree=Show automatic ECM tree
 ##### Resource ####
 ResourceSetup=Configuration du module Resource
 UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).