User tests: Successful: Unsuccessful:
Pull Request for Issue # .
#45087
testing instructions has been given in the issue this PR is trying to fix ( #45087 )
[
Go to Content - Media
Mark one image and use "Rename"
Add to the file name some "$" - characters and press "Save" ( or other characters such as # etc )
]
when a filename including symbols such as $ , ! is renamed it throws 2 errors , 1) "Error renaming item" ( which is correct )
2) move file is not possible as destination already exists ( which is incorrect and inconvenient to the user as it is not stating the correct reason for the error being thrown )
error 2 is replaced by :
"File name must only have alphanumeric characters and no spaces."
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings Front End Plugins |
Labels |
Added:
Language Change
PR-5.2-dev
|
Title |
|
Title |
|
can someone explain why a test isn't passing ?
cause PHP code style is failing
check yourself https://ci.joomla.org/joomla/joomla-cms/83395/1/7
Going to perhaps sound stupid but 2 concerns:
That's a long error message - especially when you consider that when you translate it to other language the length can grow by 30%-40%...
I don't (for me) think the message is descriptive enough - why not, a compromise:
from: Could not make the file name safe. The file name contains invalid characters.
(1 invalid character)
to: Could not save the file name safely, due to invalid character(s): $.
(2 invalid characters)
to: Could not save the file name safely, due to invalid character(s): $, &
Also, why not strip out all of the problem characters to make the filename safe?
then the 2nd line of the error message could be displayed jut as an explanation.
Hey @exlemor ,
Regarding stripping off the characters to make the filename safe :
In my opinion it is better to throw an error instead.
example : if the user wants save the file as banner#1 instead of saving the file as banner1 it is better to throw an error and the user can think of a more convenient name like banner_1.
I agree with the error message being not descriptive enough
do you think "invalid character used. Please use numbers , letters , - , _ ( and whatever else is allowed ) only" is a better alternative as the error message 1 already mentions that the renaming of the file was unsuccessful ??
Thank you for taking your time out to go through this PR and interested in hearing your opinion further.
Hello hiteshm0,
I think:
invalid character used. Please use numbers , letters , - , _ ( and whatever else is allowed ) only
vs
Could not save the file name safely, due to invalid character(s): $, &
makes your error message way too long in terms of length... and that's in English.. so if you wanted to go in your direction in terms of meaning:
Please use only numbers, letters and - , _. Invalid character(s) used: $, &.
(I would still specify the incorrect character or characters used to be most easy to understand)
as already explained we have an existing language string that should be used. pointless to create extra work for translators etc
JLIB_MEDIA_ERROR_WARNFILENAME
Category | Administration Language & Strings Front End Plugins | ⇒ | Front End Plugins |
@brianteeman Thank you for your feedback, I've fixed it now. Are there any other issues ?? Would be happy to learn .
any updates on this ?
When a pull request has two successfully tests by two users, who are not the author of the pull request, it gets "Ready to Commit" status and label. Then maintainers will review and merge if ok.
And just because something is tested the maintainers may decide, that its a change or feature that they dont want to accept.
Title |
|
Title |
|
Labels |
Added:
PR-5.3-dev
Removed: Language Change |
Category | Front End Plugins | ⇒ | External Library Composer Change Front End Plugins |
Labels |
Added:
Composer Dependency Changed
|
Category | Front End Plugins External Library Composer Change | ⇒ | Front End Plugins |
Labels |
Removed:
Composer Dependency Changed
|
Can someone please review and test this, Thank you 👍 .
Title |
|
@hiteshm0 Suggested title "[5.2] Fix where an error failing explain the correct reason for failure to rename a file is being thrown".
Personal i don't understand the title, but that may belong to my english skills. So i suggest only the unneeded informations.