Rename incorrectly cased files#30802
Rename incorrectly cased files#30802SharkyKZ wants to merge 9 commits intojoomla:stagingfrom SharkyKZ:j3/fix/file-casing
Conversation
|
I would prefer to have this in the framework at least the actual renaming including tests for all possible variants. |
|
@SharkyKZ I merged current j3 into your pr and tested the upgrade and some basic functionality and it still works. Would you remove the draft status. @bembelimen cherry picked the relevant commit for j4 in #31804 to fix the release blocker. So it would makes sense to merge this into j3 to complete the task. thanks |
|
Test cases:
Now check the file list again => files should in all three test cases have the correct name. Especially on windows system tests are needed. |
|
I have tested this item ✅ successfully on f349349 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30802. |
|
Following @bembelimen testing instructions above on OSX all the files mention are deleted after applying patch and not renamed. Admittedly OSX isn't exactly a realistic host. But yeah not working :( |
|
Tested on win10 and it works as described, Files are renamed. |
|
I have tested this item ✅ successfully on f349349 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30802. |
|
@wilsonge Do you think you can find the time to add some debug log (error_log or whatever) to see what goes wrong on OSX? |
|
@wilsonge can you run only the relevant code? |
|
I postponed it after 3.9.24 release so not urgent except that j4 waits for this pr #31804 and PRs pending on it like skipTo js update |
So I've run this in the root dir of Joomla to decouple of it - same behaviour. var_dumps on OSX give me: Not 100% sure what I'm expecting to be seeing on other filesystems as a comparison though. If you and @bembelimen could give the results of those 4 vars on windows and linux would be helpful so I can compare And the path |
|
@wilsonge The problem might be that the Update after 2 minutes: Sorry, I was wrong, the path to the file is different, so that should not be the problem. |
|
|
|
@wilsonge I think the problem is what is mentioned in the comment on https://www.php.net/manual/en/function.realpath.php:
That seems to work differently on Windows and OSX: On Windows the @bembelimen Could you check the value of Update: See also discussion in https://bugs.php.net/bug.php?id=67220. |
|
@wilsonge I think the solution could be to use That would be for your testing script: |
|
Meanwhile it turned out that my above suggestion won't help, thanks @wilsonge for testing on OSX. Am investigating possible solutions. Stay tuned. |
|
it may or may not be osx it self, it could depend on the filesystem used in osx and if it's setting os x supports both case sensitive and insensitive files per setting per filesystem. btw. I think it's possible we have the same problem on windows and linux. |
I agree. But I think I have a solution almost ready. |
|
@wilsonge or whoever else has OSX for testing: Please test the following test script: |
|
That works. But it does try and rename the file on every run. |
I know 😄 . No idea how I can avoid that. P.S.: That's only a problem on that kind of file system. On Linux it tries it only 1 time. P.P.S.: ... and it is a problem on Windows now, too, I think. |
|
@wilsonge Do you also have Windows for testing? |
|
@wilsonge Could you add following to the test script just below the other Update: Meanwhile I can test on Windows, too. Using e.g. |
|
@wilsonge New testing script: |
it just deletes the file |
|
So no change. Then we either do my previous idea with the inode which renames the file always, or I have no idea what else we can do. |
|
The extra var_dumps are more interesting though - |
|
Interesting .. and exactly that's the problem. We don't really get the actual case. |
|
@wilsonge Next iteration: Could you test with the following test script? Thanks in advance. |
I'd say that looks pretty good! |
|
Made PR https://github.com/SharkyKZ/joomla-cms/pull/8 with these changes. |
|
Closing in favour of #32006 . |
|
@bembelimen @chmst @softforge @wilsonge Please test PR #32006 . |

Closes #23725 and #30736 .
Summary of Changes
This PR attempts to implement case sensitive file rename and rename some incorrectly cased files.
Testing Instructions
Coming soon.
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Documentation Changes Required
No.