No Code Attached Yet bug
avatar dautrich
dautrich
16 May 2023

Steps to reproduce the issue

  1. Use or create a site with at least one additional frontend template (in addition to Cassiopeia)
  2. Login to the backend and move to System - Site Templates
  3. Open 'Details and Files' of your additional template
  4. Unfold the folders under /media/templates/site/[Your template]

Expected result

Within each folder, the files should be displayed in alphabetical order

Actual result

Within each folder, the files are not displayed in alphabetical order:

Screenshot 2023-05-16 at 11-32-04 Templates Customise (J51_skylar) - Lebenswert Neudorf - Administration

System information (as much as possible)

Joomla 4.3.1, template 'Skylar_J4' from Joomla51 (Version 1.1.8)

Additional comments

avatar dautrich dautrich - open - 16 May 2023
avatar joomla-cms-bot joomla-cms-bot - change - 16 May 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 May 2023
avatar dautrich dautrich - change - 16 May 2023
The description was changed
avatar dautrich dautrich - edited - 16 May 2023
avatar richard67
richard67 - comment - 16 May 2023

Joomla 4.3.1, template 'Skylar_J4' from Joomla51 (Version 1.1.8)

I think the Skylar template is not the problem here as the template manager runs in the administrator (backend).

@dgrammatiko Does the ordering of the files and folders in the template manager somehow depend on the template's XML file? I don't think so, but I thought I ask you, maybe you know it better.

avatar richard67 richard67 - change - 16 May 2023
Labels Added: bug
avatar richard67 richard67 - labeled - 16 May 2023
avatar dgrammatiko
dgrammatiko - comment - 16 May 2023

AFAIR the order is what comes out of the readdir php function. There shouldn’t be affected by anything in the xml file

avatar richard67
richard67 - comment - 16 May 2023

AFAIR the order is what comes out of the readdir php function. There shouldn’t be affected by anything in the xml file

Yes, that's what I would think, too. It seems readdir doesn't necessarily work in alphabetical order. There is a StackOverflow topic about that, where someone recommends to use scandir instead: https://stackoverflow.com/questions/541510/php-readdir-not-returning-files-in-alphabetical-order .

avatar dgrammatiko
dgrammatiko - comment - 16 May 2023

@richard67 actually I was wrong, the output is what comes out from scandir:

Possible solution https://itecnote.com/tecnote/php-sort-directory-listing-using-recursivedirectoryiterator/

avatar richard67
richard67 - comment - 16 May 2023

@richard67 actually I was wrong, the output is what comes out from scandir:

Hmm, that's strange. Maybe we have to sort that somehow? I will check when I have more time.

avatar dgrammatiko
dgrammatiko - comment - 16 May 2023

I think it's the recursive part that breaks the order (or maybe not)

avatar Hackwar Hackwar - change - 25 Aug 2023
Labels Added: PBF
avatar Hackwar Hackwar - labeled - 25 Aug 2023
avatar rdeutz
rdeutz - comment - 26 Aug 2023

tried to reproduce the bug but couldn't confirm

avatar brianteeman brianteeman - change - 1 Sep 2023
Labels Removed: PBF
avatar brianteeman brianteeman - unlabeled - 1 Sep 2023
avatar dautrich
dautrich - comment - 6 Sep 2023

@rdeutz Do you think my screenshot is a fake? I see the bug daily when looking into my template.

avatar dautrich
dautrich - comment - 22 Apr 2024

I changed the title of this issue because it still shows under J5.1:

grafik

avatar dautrich
dautrich - comment - 22 Apr 2024

@richard67 @dgrammatiko
This is not a severe issue, but a bit annoying. Could you pls check again?

avatar dgrammatiko
dgrammatiko - comment - 22 Apr 2024

What's your operating system of the server that this issue occurs?

avatar dautrich
dautrich - comment - 22 Apr 2024

=============
Systeminformationen

php: Linux sh16-23 5.15.0-73-generic #80-Ubuntu SMP Mon May 15 15:18:26 UTC 2023 x86_64
dbserver: mysql
dbversion: 8.0.33-0ubuntu0.20.04.1
dbcollation: utf8mb4_0900_ai_ci
dbconnectioncollation: utf8mb4_0900_ai_ci
dbconnectionencryption:
dbconnencryptsupported: true
phpversion: 8.3.6
server: Apache
sapi_name: cgi-fcgi
version: Joomla! 5.1.0 Stable [ Kudumisha ] 16-April-2024 16:00 GMT
compatpluginenabled: true
compatpluginparameters:
useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

avatar Quy
Quy - comment - 22 Apr 2024

On the server, browse /media/templates/site/j51_skylar/css to see how these files are listed.
If possible, install on a different server to see if it is reproducible.

avatar brianteeman
brianteeman - comment - 22 Apr 2024

just to rule something out can you p;ease retest with Joomla in English

avatar dautrich
dautrich - comment - 22 Apr 2024

grafik

avatar dautrich
dautrich - comment - 22 Apr 2024
avatar dautrich dautrich - change - 22 Apr 2024
Title
[4.3] Template Manager - Some folders not displayed in alphabetical order
[5.1] Template Manager - Some folders not displayed in alphabetical order
avatar dautrich dautrich - edited - 22 Apr 2024
avatar dautrich
dautrich - comment - 22 Apr 2024

@Quy
I just tested a different website (but with the same template) on localhost via XAMPP, but I get exactly the identical issue:

grafik

=============
System Information

php: Windows NT DP3450 10.0 build 22631 (Windows 11) AMD64
dbserver: mysql
dbversion: 10.4.32-MariaDB
dbcollation: utf8mb4_general_ci
dbconnectioncollation: utf8mb4_general_ci
dbconnectionencryption:
dbconnencryptsupported: false
phpversion: 8.2.12
server: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
sapi_name: apache2handler
version: Joomla! 5.1.0 Stable [ Kudumisha ] 16-April-2024 16:00 GMT
compatpluginenabled: true
compatpluginparameters:
useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

avatar brianteeman
brianteeman - comment - 22 Apr 2024

can you confirm that you only see it with this template?

avatar dautrich
dautrich - comment - 23 Apr 2024

@brianteeman Yes, because it is the only one I use (apart from test sites with Cassiopeia). Should we try to involve Ciaran Walsh?

avatar dgrammatiko
dgrammatiko - comment - 23 Apr 2024

@dautrich what Brian asked was to try to open the cassiopeia files view and report if those files are displayed properly sorted.

avatar dautrich
dautrich - comment - 23 Apr 2024

I've set Cassiopeia to standard template for all files. Looking at the template files, they are properly ordered.

Having seen this, I also believe that the issue is something related to the Skylar template.

If you don't want to invest any more time in this, I'm going to close this issue.

avatar brianteeman
brianteeman - comment - 23 Apr 2024

If you don't want to invest any more time in this, I'm going to close this issue.

The problem is that no one has reproduced this and as the template youare using it is commercial we dont have access to reproduce it ourselves with that template

avatar HLeithner
HLeithner - comment - 23 Apr 2024

I found the issue and will prepare an pr in a couple of minutes.

avatar HLeithner HLeithner - change - 23 Apr 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-04-23 09:07:32
Closed_By HLeithner
avatar HLeithner HLeithner - close - 23 Apr 2024
avatar HLeithner
HLeithner - comment - 23 Apr 2024

Please test #43335 closing this.

Add a Comment

Login with GitHub to post a comment