Patch (to be ported)
Project:
Transliteration
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2013 at 22:20 UTC
Updated:
8 Apr 2017 at 16:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
David_Rothstein commentedHere is a patch that fixes the issue.
I guess it could be argued this behavior should be controlled by an option in the admin UI, but I think not touching the human-readable name is what's expected so this patch just fixes it always.
Comment #2
amateescu commentedI guess we need to turn this into an optional behavior. Patches welcome :)
Comment #3
David_Rothstein commentedWow, that was a quick crosspost! (And yes, looks like we had the same idea about turning it into an optional behavior.)
Comment #4
amateescu commentedHeh, that was funny :) So, while this may be the expected behavior, the current status quo is that it is happening, and existing sites might rely on it. So I think we need the checkbox in this patch, defaulting to the value of 'transliteration_file_uploads'.
Comment #5
David_Rothstein commentedOK, here is a reroll that adds a checkbox.
I thought it would make sense to add #states to hide this checkbox when it's not relevant, but afterwards realized that the checkbox underneath it is in the same situation. So rather than undo what I did, I just added #states in both places.
Comment #6
amateescu commentedHm.. so you bypassed defaulting to the value of 'transliteration_file_uploads' by checking it too. I guess that's ok :)
Committed to 7.x-3.x and moving to 6.x-3.x for backport.
http://drupalcode.org/project/transliteration.git/commit/a4aba37
Comment #7
David_Rothstein commentedThanks for the incredibly fast review and commit! Yeah, it seemed simpler to me to just keep the two variables totally separate - forgot to mention it when I posted the patch though.
Comment #8
amateescu commentedTaking a small break from core does wonders for contrib :P Thank you as well for the patch.
Comment #9
mtoscano commentedHI,
I don't see any difference when I uncheck this option.
I am using File Entity and Media with this patch and with both options (checked/unchecked) the file name is transliterated during upload. By contrast, it is not transliterated with both options if the name is edited after upload.
If I remove the patch the file name cannot be set during upload and user need to re-edit it to set a proper name instead of the file name (transliterated or not).
Am I missing something?
Comment #10
mtoscano commentedHi,
I find out something interesting. If files are uploaded to the Media root folder their file names are not transliterated with this option unchecked, so it works as expected.
Instead, if files are uploaded to a different nested folder the file name it is always transliterated.
Folders (taxonomy terms that can create also physical folders on the server) are added to the Media module by the Media Browser Plus module.
Is it possible to adjust this patch in order to works with files upload also in nested folders?
Thanks
Comment #11
nixar commentedI think there is a problem with the patch provided in #5 because the code does the opposite of what the new variable is expected to do.
If you check the box, you decide to transliterate the filename, if you don't check it, you leave it as is but in the code, the checking is done against the opposite value:
so instead shouldn't it be
?
Comment #12
David_Rothstein commented@nixar, I wrote this years ago so I don't really remember, but from reading the code comment it looks correct as is. I think it checks the opposite condition since the code is undoing the transliteration, not transliterating it.
Is the functionality not actually working for you when you try it? If so, check #9 and #10 above (those sound like they could be actual bugs), and if so, a followup issue to fix that would be a good idea.