Merge filename with title doesn't work in other languages

34 views
Skip to first unread message

Trond Helge Rolland

unread,
Jun 8, 2025, 3:13:16 AM6/8/25
to ResourceSpace
A bit of an odd problem that I've yet to figure out why, we have a 10.6 installation under test (upgraded to the latest release), and since we have a rather large archive of images we want to upload without too much extra metadata entering (and some images stored with the name "Component XYZ 2021.jpg"), the $merge_filename_with_title setting to true makes this lot easier as it automatically sets the title as the filename from the file ("Component XYZ 2021") and one can save all the uploaded files at once. 

But, as we have users who also prefer menus et al to be in their native language, some have selected to use Norwegian (or Swedish) as the gui language, which is fine of course. But: When the language is set to Norwegian or Swedish (or probably other languages as well),  the upload of a new image will not set the title automatically. It will then be blank (and since it's obligatory you have to manually set the title for all the images you're trying to upload, adding a lot of extranous steps in the process). 

Setting the language back to default English and new files comes with the correct title again, so it's only when the gui language is set to non default this happens.

I can't see any reason why the language files should interfer with this functionality, I don't see anything obvious in the language files themselves either. 

Trond Helge Rolland

unread,
Jul 3, 2026, 8:37:31 AM (19 hours ago) Jul 3
to ResourceSpace
It's only been a year, but the new release gave me an excuse to look this up again. 

Turns out in image_processing.php ( resourcespace/include/image_processing.php at master · resourcespace/resourcespace · GitHub) uses a switch that checks for the variable merge_filename_with_title_option ( merge_filename_with_title_default in config), but then uses the selection in the language file as a lookup for the name. So since  $lang['merge_filename_title_replace'] = 'Replace'; is in en.php, but for us in Norwegian (and other languages) this will not match the setting and the form will not merge filename with the title of the resource. 

So if no option is chosen, it defaults to the setting in config.php (which is set to replace), but then it will only do what we want it do if the user language is in English because it won't match in other languages.

This would all work if the form to set this default setting was available, but I it appears the form option (in user preferences or system settings) is invisible so we can never set this option. 
(just replacing the value in the language file solves this temporarily at least). 

My suggestion is either to make this option properly available, or make the code non-language dependant. 

(I might have to be more active on github at this point, I've found a few other bugs/changes in 11.0)

Trond Helge Rolland

unread,
Jul 3, 2026, 9:36:23 AM (18 hours ago) Jul 3
to ResourceSpace
.. and the root of all this is a misplaced < symbol in pages/edit_fields/0.php on line 5. It checks resource reference and only shows the options form if $ref is below 0 instead of above 0 (also, I assume this verification is done prior to this part so seems kind of redudant). 

So the misplaced < causes the form to be hidden, and since the form is language settings based the controls are also dependent on language. And since the form never will be shown, it defaults to the setting from config.php but that is in english so you would only get the expected behaviour in default language mode. 
Reply all
Reply to author
Forward
0 new messages