? Success

User tests: Successful: Unsuccessful:

avatar alikon
alikon
4 Feb 2019

Pull Request for Issue #23725 .

Summary of Changes

renamed file libraries/src/Filesystem/Support/Stringcontroller.php to libraries/src/Filesystem/Support/StringController.php

Testing Instructions

run: php build/stubGenerator.php

Expected result

file written

Actual result

Error: Failed to start application: Class Joomla\CMS\Filesystem\Support\StringController does not exist

avatar alikon alikon - open - 4 Feb 2019
avatar alikon alikon - change - 4 Feb 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Feb 2019
Category Libraries
avatar Bakual
Bakual - comment - 4 Feb 2019

You renamed it to StringcController.php. There is a c to much in there ?

avatar alikon alikon - change - 4 Feb 2019
Labels Added: ?
avatar alikon
alikon - comment - 4 Feb 2019

yes ,fixed thanks

avatar brianteeman
brianteeman - comment - 4 Feb 2019

Its not that easy :(

Changing filename case on a windows system on upgrade is a PIA

We've had this before although right now I forget exactly what the file was - perhaps @mbabker remembers

avatar Bakual
Bakual - comment - 4 Feb 2019

Brian is right.
Windows is actually fine. It's Linux where you get an issue because they count as different files and you end up with two files.
Now we can add the old file to be deleted into the admin script, which would work on Linux. But it would fail on Windows since it would delete the new file (it ignores case).
So there is no simple solution. You would need a script which checks OS or if the file is there twice and only then delete it.
I think last time we had that issue we just moved the file to another location, then it's simple.

avatar mbabker
mbabker - comment - 4 Feb 2019

I think last time we had that issue we just moved the file to another location, then it's simple.

Which means deprecating yet another class and renaming it something else when talking about any file that contains a PHP class following an autoloading convention.

avatar mbabker
mbabker - comment - 4 Feb 2019

We've had this before although right now I forget exactly what the file was - perhaps @mbabker remembers

IIRC that was when the JClassLoader file was at the root of the libraries directory with a camel cased filename or something like that and we just shoved it into the libraries/cms directory following the normal file convention.

avatar Bakual
Bakual - comment - 4 Feb 2019

Which means deprecating yet another class and renaming it something else when talking about any file that contains a PHP class following an autoloading convention.

Yep exactly. Not a nice way, but the easiest one.

avatar HLeithner
HLeithner - comment - 12 Feb 2019

We could fix the deletion process at https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_admin/script.php#L2257-L2263

if we use realpath to get the real filename we also get the correct case

something like this (just a idea)

if (JFile::exists(JPATH_ROOT . $file) && realpath(JPATH_ROOT . $file) === JPATH_ROOT . $file && !JFile::delete(JPATH_ROOT . $file))
avatar joomla-cms-bot joomla-cms-bot - change - 12 Feb 2019
Category Libraries Administration com_admin Libraries
f9b2030 12 Feb 2019 avatar alikon slash
avatar alikon
alikon - comment - 12 Feb 2019

...could be

avatar HLeithner
HLeithner - comment - 12 Feb 2019

Maybe I didn't explained it correct but the reason to use realpath is to match the filename with case on disk with the filename we want to delete.

if you use this code you gain nothing, you have to compare the result auf realpath with the filestring we want to delete.
JFile::exists uses is_file and this is case insensitive, the same is true for unlink used by JFile::delete

btw I think JFile::exists can be omitted because JFile::delete does this anyway

avatar alikon
alikon - comment - 12 Feb 2019

no it's me on the train ?

avatar HLeithner
HLeithner - comment - 12 Feb 2019

hmm this will not work if your webserver access the site with a symlink... So we need more magic here

avatar HLeithner
HLeithner - comment - 13 Feb 2019

@mbabker do you have a idea? Maybe testing realpath(JPATH) and realpath($PATH) seperated?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Apr 2019

@Orgoth please retest (test comment in #23725 was in february) and mark your test as successfully > https://docs.joomla.org/Testing_Joomla!_patches#Recording_test_results

avatar Orgoth
Orgoth - comment - 24 Apr 2019

I have tested this item successfully on d6f533e

isley@isley:~/repos/test/joomla$ php build/stubGenerator.php
Stubs file written

File was created and looks good so far.

-rw-rw-r--  1 isley isley  54439 Apr 24 14:15 stubs.php

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762.
avatar Orgoth Orgoth - test_item - 24 Apr 2019 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 24 Apr 2019
Labels Removed: J3 Issue
avatar gwsdesk
gwsdesk - comment - 27 Apr 2019

I have tested this item successfully on 8ff8935


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762.

avatar gwsdesk gwsdesk - test_item - 27 Apr 2019 - Tested successfully
avatar gwsdesk
gwsdesk - comment - 27 Apr 2019

@Orgoth can you please post your successful test at the Tracker? We can merge it than since we have 2 successful tests

avatar HLeithner
HLeithner - comment - 27 Apr 2019

It would be great if testers add the operating system to the test node, because this could lead to problems on different Systems.

avatar Orgoth
Orgoth - comment - 29 Apr 2019

I have tested this item successfully on 8ff8935

### Details:
System Kubuntu 18.04 LTS
PHP Built On Linux isley.lc 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64
Database Type mysql
Database Version 8.0.15-5
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_0900_ai_ci
PHP Version 7.1.28-1+ubuntu18.04.1+deb.sury.org+3
Web Server Apache/2.4.39 (Ubuntu)
WebServer to PHP Interface fpm-fcgi


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762.

avatar Orgoth Orgoth - test_item - 29 Apr 2019 - Tested successfully
avatar HLeithner
HLeithner - comment - 29 Apr 2019

A windows test would be awesome.

avatar Orgoth
Orgoth - comment - 29 Apr 2019

I am very sorry, but I only develop under Linux.
Maybe @gwsdesk has the possibility to test under Windows.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762.

avatar Orgoth
Orgoth - comment - 29 Apr 2019

I am very sorry, but I only develop under Linux.
Maybe @gwsdesk has the possibility to test under Windows.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762.

avatar brianteeman
brianteeman - comment - 29 Apr 2019

stubgenerator runs fine no matter the case of that file on windows

avatar HLeithner
HLeithner - comment - 29 Apr 2019

thx @brianteeman did you tested it with already existing files, lower and uppercase before and after upgrade?

avatar brianteeman
brianteeman - comment - 29 Apr 2019

I ran the script before renaming the file and after renaming the file - it ran correctly in both cases

avatar bembelimen
bembelimen - comment - 29 Apr 2019

I have tested this item ? unsuccessfully on a0538dc

In windows this PR breaks the whole deletion process, because realpath converts all slashes to \, so it's always not true (and the JFile::delete will never be called).

Additional there will not be 2 files in windows, so the deletion process (if it works) would delete the whole file without replacement.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762.

avatar bembelimen bembelimen - test_item - 29 Apr 2019 - Tested unsuccessfully
avatar HLeithner
HLeithner - comment - 1 May 2019

Ok so we have to find another solution, I would suggest an own function for renaming files, before calling the delete function.

avatar alikon alikon - change - 1 May 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-05-01 09:11:51
Closed_By alikon
avatar alikon alikon - close - 1 May 2019

Add a Comment

Login with GitHub to post a comment