Bug? System setting upload_translit removes "." before file extension

Whenever I upload a file within the media browser, the dot . before the file extension gets truncated. This causes an uploaded image.jpg to be uploaded as imagejpg, also file.pdf gets filepdf.

When I turn off the system setting upload_translit this does not happen anymore and everything works as expected.

This is obviously a bad thing to happen. I found a thread discussing the lowercase part of this setting, but nobody mentioned this specific issue.

Therefore is this a bug or is this something that’s somehow just happening to my setup?

MODX 3.0.4
PHP 8.2

What’s the value of the system setting friendly_alias_restrict_chars_pattern?
If a . is in the pattern, then this could explain the behavior.

See also this issue on Github:

Yes, that’s it. I added a dot in there a while ago, because I don’t like having dots in the url-alias. Didn’t think that this would also be used for file uploads. Is there a way to seperate those or make the upload part use a different setting? It’s not a big problem as I will just deactivate upload_translit but in general this might be a considerable improvement.

Thank you!

You could try creating a context setting with the same name friendly_alias_restrict_chars_pattern and a different value.

I believe for the URL alias the context setting would be used, and for the file upload the system setting. But I could be wrong.

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.