[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] File name in File Gallery changes on upload/update without option

"MAGENE Sem Joel \(@Jomagene\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a1857fe486b4_381939f88399b@gitlab-sidekiq-low-urgency-cpu-bound-v2-7cddd569c8-8pmjv.mail>

MAGENE Sem Joel pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
9aa8e894 by NasserNgandu at 2026-05-28T14:51:19+00:00
[FIX] File name in File Gallery changes on upload/update without option
---
* [FIX] Code Correct

* [FIX] Code correct

* [FIX] Pipeline Correct.

* [FIX] Pipeline Correct.

* [FIX] The value for the name of a file in a tiki file gallery is changed on upload and on each update without option for it.

See merge request tikiwiki/tiki!9758

- - - - -


3 changed files:

- lib/Filegals/FileGalLib.php
- lib/core/Tiki/FileGallery/Manipulator/MetadataExtractor.php
- lib/test/core/Tiki/FileGallery/Manipulator/MetadataExtractorTest.php


Changes:

=====================================
lib/Filegals/FileGalLib.php
=====================================
@@ -3423,7 +3423,7 @@ class FileGalLib extends TikiLib
                     }
 
                     if (empty($params['name'][$key])) {
-                        $params['name'][$key] = $this->getTitleFromFilename($name);
+                        $params['name'][$key] = pathinfo($name, PATHINFO_FILENAME);
                     }
 
                     if (empty($params['deleteAfter'][$key]) || empty($params['deleteAfter_unit'][$key])) {


=====================================
lib/core/Tiki/FileGallery/Manipulator/MetadataExtractor.php
=====================================
@@ -21,7 +21,7 @@ class MetadataExtractor extends Manipulator
         $file->setParam('metadata', $metadata);
 
         if ($file->name === $file->filename && ! $file->galleryDefinition()->isDirect()) {
-            $name = TikiLib::lib('filegal')::getTitleFromFilename($file->name);
+            $name = pathinfo($file->name, PATHINFO_FILENAME);
         } else {
             $name = $file->name;
         }


=====================================
lib/test/core/Tiki/FileGallery/Manipulator/MetadataExtractorTest.php
=====================================
@@ -66,7 +66,7 @@ class Tiki_FileGallery_Manipulator_MetadataExtractorTest extends TikiTestCase
         $this->file->setParam('name', 'test-data.png');
         $this->file->setParam('filename', 'test-data.png');
         (new MetadataExtractor($this->file))->run();
-        $this->assertEquals('Test Data', $this->file->name);
+        $this->assertEquals('test-data', $this->file->name);
     }
 
     public function testCreatedSoon()



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9aa8e894d5788c9c8fd32ba56b4f9a84412c1aa4

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/9aa8e894d5788c9c8fd32ba56b4f9a84412c1aa4
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.