#24049 closed defect (bug) (worksforme)
Make Plugin Editor's file list alphabetical by full path
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8 |
Component: | Plugins | Keywords: | |
Focuses: | administration | Cc: |
Description
The files under Plugin Editor's (plugin-editor.php) Plugin Files header should be shown in alphabetical order of their full path. Currently their order seems completely random, which makes the list cumbersome to use.
Attachments (3)
Change History (16)
#5
@
10 years ago
- Milestone changed from Awaiting Review to 4.1
- Owner set to SergeyBiryukov
- Status changed from new to accepted
#6
@
10 years ago
Sorry to report on further testing that this doesn't work fully.
By returning a sorted list of plugin files the 'first' entry returned may not be the main plugin file and it may also not be a file supported in the editor - resulting in unusual behaviour.
The sort needs to return the array with the main file at the start of the array or somehow that file needs to be 'selected' by default.
#7
@
10 years ago
Attached patch resolves the issued stated above by placing the main plugin file name at the start of the returned array.
I've also dropped the root file sorting section with the preg_match - it doesn't seem to change the returned values and also causes errors as the regex is not properly contained - I was getting lots of errors log about invalid operators.
#8
@
10 years ago
- Keywords needs-unit-tests needs-patch added; has-patch removed
- Milestone changed from 4.1 to Future Release
If you select a file in a subdirectory for editing, the list of files in the sidebar completely breaks, and the current plugin is not correctly selected. I can't believe there isn't an existing ticket for this.
I think that's closely related to this and they should be fixed together. get_plugin_files()
should probably always be passed the plugin's root file, not the file being currently edited.
We should also get some unit tests on this.
Related: #24048
#11
@
6 years ago
- Keywords close added; needs-unit-tests needs-patch removed
This appears to be fixed in [41806], I can't reproduce any issues with file order in current trunk. The list includes:
- The main plugin file.
- The rest of the files, in alphabetical order.
#12
@
3 years ago
- Keywords close removed
- Resolution set to worksforme
- Status changed from accepted to closed
I am also unable to reproduce this one. The only thing that feels a bit strange is that files beginning with a capital letter appear before any starting with lowercase. But they are all sorted alphabetically in those two groups. Some common files that "rise to the top" and appear under the main plugin file are any CHANGELOG/CONTRIBUTING/LICENSE/README.md files.
I think this is acceptable, though, and this one can be considered fixed by way of [41806].
#13
@
22 months ago
Could this be reopened? I have this problem am the time in my local environment (that i know of) and it's really annoying.
https://twitter.com/Kathy_Darling/status/1658886811614052368?t=hNttzcEKZab8DCi4tWM1DQ&s=19
Ideally I'd to see
Folder1
Folder2
File1
File2
Instead of the current mishmash
Sorts file list alphabetically by full path and improves performance of get_plugin_files() by calling plugin_basename() only once