Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Some class errors #25422

Merged
merged 15 commits into from
Jul 10, 2019
Merged

[4.0] Some class errors #25422

merged 15 commits into from
Jul 10, 2019

Conversation

SharkyKZ
Copy link
Contributor

@SharkyKZ SharkyKZ commented Jul 4, 2019

Pull Request for Issue # .

Summary of Changes

Rename SysinfoModel.php to SysInfoModel.php.
Typo in Joomla\Component\Privacy\Site\Service\Router.

Testing Instructions

Code review? CC @wilsonge

Documentation Changes Required

No.

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Jul 4, 2019

Don't know if changing file casing causes issues at this point. If it does, we can rename the class instead?

@brianteeman
Copy link
Contributor

typo looks correct to me
not sure about the camelcase name change - renaming this way always causes issues

@richard67
Copy link
Member

Maybe just leave the file name as it is and only correct the typo?

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Jul 4, 2019

@richard67 that won't fix the issue. We need to either rename the file or rename the class and change all instances of it in code.

Anyways, this is fine, I think, if updates between alphas aren't officially supported.

@richard67
Copy link
Member

@SharkyKZ Ah, yes I forgot that with the update support ;-)

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Jul 4, 2019

Hm, there are more instances of this:

\Joomla\Component\Menus\Administrator\Field\ComponentsCategoryField
\Joomla\Component\Menus\Administrator\Field\MenuOrderingField

Rename classes or rename files? Renaming files also requires updating XML files but it would be nice to have correctly cased classes at some point.

@richard67
Copy link
Member

Hmm, I don't remember right now how such renames were handled in past, was not involved in that, just reading some PR when passing by long time ago. George maybe remembers that better.

@wilsonge
Copy link
Contributor

wilsonge commented Jul 4, 2019

We had to rename them in two commits - to a different name and back again for git to be happy. Then that still doesn't work on shared hosts (but at this stage in j4 we don't guarentee b/c there so it's not a problem).

TL/DR - just rename the files and let's do this correctly and set the correct precedent :)

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Jul 5, 2019

Hm, I think it's better to rename SysInfoModel and revert the filename change. The view is called Sysinfo so it tries to load SysinfoModel by default anyways.

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Jul 5, 2019

Unless we want to rename the view, which also means updating all links to it.

@wilsonge
Copy link
Contributor

wilsonge commented Jul 5, 2019

No I think keeping the existing view type makes sense

@SharkyKZ
Copy link
Contributor Author

SharkyKZ commented Jul 6, 2019

So this PR should be fine as it is. Just found more of the same:

\Joomla\CMS\Encrypt\AES\Openssl
\Joomla\CMS\Filesystem\Support\StringController
\Joomla\CMS\Form\Field\SQLField

StringController has already been reported for 3.x (#23725). Other two are 4.0-specific.

@wilsonge wilsonge merged commit c579137 into joomla:4.0-dev Jul 10, 2019
@wilsonge
Copy link
Contributor

This will do as a first pass - thankyou @SharkyKZ !

@wilsonge wilsonge added this to the Joomla 4.0 milestone Jul 10, 2019
@SharkyKZ SharkyKZ deleted the patch-1 branch July 10, 2019 10:46
@Orgoth
Copy link

Orgoth commented Jul 11, 2019

Do these changes also work under Windows?
In my ticket (#23725) the developers also tried to rename the StringController and encountered problems with the update mechanism when changing a file name to upper or lower case under Windows.

Quote #23762:

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.

@SharkyKZ
Copy link
Contributor Author

@Orgoth this PR fixes only new files added in 4.0. Updates between 4.0 dev builds aren't supported, so if you try to update from older 4.0 version, you'll have to apply the filename changes manually or just use a new 4.0 installation.

This, however, won't be an issue when updating from 3.x because these files do not exist in 3.x.

@ghost
Copy link

ghost commented Jul 11, 2019

Updates from Nightly > Nightly Build will be supported at Beta.

@wilsonge
Copy link
Contributor

@SharkyKZ The field class rename broke the system tests so we've reverted back to how it was for now #25530 and will need to come up with an alternative fix

@SharkyKZ
Copy link
Contributor Author

@wilsonge My bad, it's a field class 🤦‍♂ . We'd need to update the type in forms to use the new casing. As a simple alternative we could rename the class to SqlField.

@wilsonge
Copy link
Contributor

Lets just rename the class back to lowercase I think - i mean uppercase SQL is just a nice to have

@wilsonge
Copy link
Contributor

The casing in the field type hasn't changed from 3.x so I'd rather not change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants