From 82b066ac00aaa2eedd16d97c495897052d86d220 Mon Sep 17 00:00:00 2001 From: "Ilya A. Zhulin" Date: Mon, 17 Jun 2024 14:45:43 +0300 Subject: [PATCH] Correction to thumb path There is an error when filename is a part of article id. For example filename is "4.jpg" and article id is "324". Path to file is "/images/type_name/324/4.jpg", but path to thumb in this case is "/images/type_name/32_thumb1/4/_thumb1/4.jpg". So, such thumb is anavailiable --- plugins/cck_field/upload_image/upload_image.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/cck_field/upload_image/upload_image.php b/plugins/cck_field/upload_image/upload_image.php index d18c96fc0..5a8c14aa7 100644 --- a/plugins/cck_field/upload_image/upload_image.php +++ b/plugins/cck_field/upload_image/upload_image.php @@ -386,7 +386,7 @@ public function onCCK_FieldPrepareForm( &$field, $value = '', &$config = array() '.$desc_image.' '; } else { - $thumb_location = str_replace( $title,'_thumb'.( $options2['form_preview'] - 2 ).'/'.$title,$value['image_location'] ); + $thumb_location = str_replace( '/'.$title.'.','/_thumb'.( $options2['form_preview'] - 2 ).'/'.$title.'.',$value['image_location'] ); $preview = ' '.$desc_image.' '; @@ -909,4 +909,4 @@ protected static function _getUserFile( $idx, $userfile, $xk, $name = '' ) return $userfile; } } -?> \ No newline at end of file +?>