We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22874
    • 1 Posts
    I made modification to modx core (2.1.1pl) that Translit can convert international chars in uploading/updating/renaming filenames. I made this for subfolders too (created/renamed from filemanager).

    mod to upload.php -> core/model/proc/browse/file/upload.php at line 80
    mod to create.php -> core/model/proc/browse/directory/create.php at line 30
    mod to update.php -> core/model/proc/browse/file/update.php at line 18
    mod to rename.php -> core/model/proc/browse/rename.php at line 28

    $current_context=$modx->context->key;
    $working_context=$workingContext->get(’key’);
    $modx->getService(’resource’, ’modResource’, ’’, array(’context’ => $working_context));
    $modx->switchContext($working_context); //workaround because contexts are ignored (unfortunately) It is another modx issue.
    $somepath=$modx->resource->cleanAlias($somepath, array(’context’ => $working_context));
    $modx->switchContext($current_context);

    Why this workround ? There is another modx context issue. Function cleanAlias is always called under mgr context. So friendly_alias_translit parameter is ignored in contexts. This parameter is very important for proper selection translation table especially in germany and russian.