No Code Attached Yet
avatar Scrabble96
Scrabble96
14 Sep 2022

What needs to be fixed

I updated to 4.2.2 from 4.2.1 and found 48 overrides to check. In many cases I couldn't see what had changed - apart from the new blank line number 2 in all of them (why?) - until I downloaded the full package, unzipped it and compared the files in Notepad++.

Whilst there are some genuine code changes it would appear that the files have now got leading spaces at the beginning of the lines instead of tabs with the one on the left being the new 4.2.2. version :

spaces-not-tabs

Why this should be fixed

I thought leading spaces in PHP files was a no-no and they should be tabs. At the very least, this should be consistent and if it was going to be changed, should have done so at 4.0, 4.1 or 4.2, not a minor update.

How would you fix it

Change them all back

Side Effects expected

None - except a lot of work changing them back again

avatar Scrabble96 Scrabble96 - open - 14 Sep 2022
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Sep 2022
avatar brianteeman
brianteeman - comment - 14 Sep 2022

Joomla switched to a coding standard called PSR12 and this uses spaces instead of tabs. @HLeithner has updated all the files with this change

avatar brianteeman
brianteeman - comment - 14 Sep 2022

I guess what could be done is to add some css to style the tabs

https://codemirror.net/5/demo/visibletabs.html

avatar HLeithner HLeithner - close - 14 Sep 2022
avatar HLeithner
HLeithner - comment - 14 Sep 2022

@Scrabble96 yes we changed the complete code base from the joomla own coding style to "the" php standard called PSR-12, this standard is using spaces instead of tabs. Sadly I missed our "layout changed feature" and that's the reason all layouts are marked as changed.

It's now a bit late about the tab vs spaces discussion, production decided to adapt psr12 (now PER Coding Style) and it's unlikely that we revert this change. The conversation happend in 4.2.0 and not in the patch released but since 4.2.0 and 4.2.1 was broken you discovered it in 4.2.2.

If someone prefer tabs instead of spaces this have to be done on PSR level. I'm closing this because nothing we can do for the moment. At least for the override notification.

avatar HLeithner HLeithner - change - 14 Sep 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-09-14 20:22:40
Closed_By HLeithner
avatar brianteeman
brianteeman - comment - 14 Sep 2022

@HLeithner what do you think about making tabs visible on that page?

avatar HLeithner
HLeithner - comment - 14 Sep 2022

They aren't visible? I think they should of course... I don't use code mirror very often so I didn't noticed... but if it help I think we should activate them.

avatar brianteeman
brianteeman - comment - 14 Sep 2022

No they're not visible but one css class and they will be. The question then is if it should be done globally for codemirror or just in the template manager.

avatar HLeithner
HLeithner - comment - 14 Sep 2022

My opinion is that it should be globaly, it's important to see tabs if you edit a source code.

avatar brianteeman
brianteeman - comment - 14 Sep 2022

I agree although the argument against would be the people using codemirror for a content editor. I will do a pr anyway with tabs on

avatar brianteeman
brianteeman - comment - 14 Sep 2022

See #38766 for visible tabs

avatar Scrabble96
Scrabble96 - comment - 15 Sep 2022

Thank you. That's a very good idea and will make it far more obvious what the changes are - particularly as the opening and closing tags in the new files didn't appear to be lined up, for some reason. But maybe it was an optical illusion.

Add a Comment

Login with GitHub to post a comment