Filebrowser: editorbrowser duplicates "Folder" in heading

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
cmb
Posts: 13274
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Filebrowser: editorbrowser duplicates "Folder" in heading

Post by cmb » Fri Dec 26, 2014 11:36 pm

Hello Community,

I've noticed that the editorbrowser duplicates the term "Folder" in its headings. For instance, there is "Userfiles Folder Folder" or "Userfiles Ordner Ordner". The obvious solution would be the following patch:

Code: Select all

Index: plugins/filebrowser/classes/Filebrowser_View.php
===================================================================
--- plugins/filebrowser/classes/Filebrowser_View.php	(revision 3)
+++ plugins/filebrowser/classes/Filebrowser_View.php	(working copy)
@@ -187,7 +187,7 @@
 
         $title = isset($tx['title']['userfiles'])
             ? utf8_ucfirst($tx['title']['userfiles'])
-            : ucfirst('Userfiles ' . $this->translate('folder'));
+            : ucfirst('Userfiles');
         $html = '<ul><li class="openFolder"><a href="?'
             . htmlspecialchars($this->linkParams, ENT_QUOTES, 'UTF-8') . '">'
             . $title . ' ' . $this->lang['folder'] . '</a>';
However, this should be carefully investigated and double-checked (I wonder why $this->translate('folder') has been introduced in the first place).

Anyway, we should fix this minor bug bug for XH 1.6.5.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 13274
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Filebrowser: editorbrowser duplicates "Folder" in headin

Post by cmb » Sun Dec 28, 2014 5:48 pm

cmb wrote:I wonder why $this->translate('folder') has been introduced in the first place
translate('folder') has been there for a long a time. The bug, however, had been introduced in r1061 when I revised the doc blocks and noticed that $plugin_tx is used in Filebrowser_View::folderList() instead of the usually more fitting Filebrowser_View::lang[]. For the editorbrowser $plugin_tx is undefined, but Filebrowser_View::lang[] is defined, so the duplication happened.

Therefore the patch suggested above is the Right[tm] solution. Done (r1422).

BTW: the text "Userfiles" should be internationalized, but I suggest to delay that until XH 1.7, when the filebrowser will hopefully be refactored to rid editorbrowser.php. I've set a @todo note to not forget about it.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply