Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356629 - PHP explorer does not sort folders or files alphabetically - sort order is erratic
Summary: PHP explorer does not sort folders or files alphabetically - sort order is er...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 179929
Blocks:
  Show dependency tree
 
Reported: 2011-09-02 14:06 EDT by Ralph Moenchmeyer CLA
Modified: 2020-05-14 11:37 EDT (History)
6 users (show)

See Also:


Attachments
Shows a folder in PHP Explorer with erratic sorting (35.21 KB, image/png)
2011-09-02 14:10 EDT, Ralph Moenchmeyer CLA
no flags Details
shows alphabetic sort order in project explorer (30.89 KB, image/png)
2011-09-02 14:11 EDT, Ralph Moenchmeyer CLA
no flags Details
screenshot (6.98 KB, image/jpeg)
2013-01-29 22:23 EST, Zhongwei Zhao CLA
no flags Details
screenshot (9.94 KB, image/jpeg)
2013-01-30 00:40 EST, Zhongwei Zhao CLA
no flags Details
Sort is wrong #1 (34.28 KB, image/png)
2013-01-31 04:18 EST, Aldrin Baroi CLA
no flags Details
Sort is wrong #2 (33.64 KB, image/png)
2013-01-31 04:18 EST, Aldrin Baroi CLA
no flags Details
All the installed components within Eclipse (254.30 KB, image/png)
2013-01-31 04:19 EST, Aldrin Baroi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Moenchmeyer CLA 2011-09-02 14:06:39 EDT
Build Identifier: Build id: I20110613-1736  (Eclipse version 3.7.0)

The PHP Explorer - in contrast to the Project Explorer - does not sort the content of projects or project subfolders alphabetically. 
This happens at least after working some time with the project contents and after including more and more folders - also linked folders. 

There is no obvious way to remedy the erratic sorting order by the eclipse user - the only way is to use other project views.  

Just in case that there might be problems with other eclipse add ons: 
In addition to PDT I use Mylyn, SVN, WDT, export utilities to publish files on remote servers and the remote system explorer utilities among other add ons. 

This bug is quite old - it appeared several in the community forum since 2008. Maybe it is a regression bug ? 

Reproducible: Always

Steps to Reproduce:
1.Generate several PHP projects 
2. Fill it with contents of different kinds - new folders, copy in folders, linked folders 
3. Fill the folders with contents 
4. Link to SVN and use checkins if you want 
5. Check the order of the folders in the PHP explorer view - looks more or less erratic 
6. Compare to "Project Explorer" view - there you get consistently alphabetical sorting on all levels of the folder and content hierarchy.
Comment 1 Ralph Moenchmeyer CLA 2011-09-02 14:10:51 EDT
Created attachment 202688 [details]
Shows a folder in PHP Explorer with erratic sorting
Comment 2 Ralph Moenchmeyer CLA 2011-09-02 14:11:36 EDT
Created attachment 202689 [details]
shows alphabetic sort order in project explorer
Comment 3 Roy Ganor CLA 2011-09-05 03:45:49 EDT
it's  because some of the folders are excluded from the build path.
we have decided to show first the buildpath directories and then list all others.

This can be turned into a feature request to enable it.
Comment 4 Aldrin Baroi CLA 2013-01-21 22:57:14 EST
For my setup, sort order is erratic only for the top-level source folders. Folders under the top-level source folders and the files are sorted correctly alphabetically.

Tried creating the top level source folders in several different orders with no success.

Wanted the following folder structure:

   src/main/php
   src/main/resources
   src/test/php
   src/test/resources

With current Eclipse setup (Juno):

  No matter what, getting the following folder structure:

    src/main/resources        <-- always before "src/main/php"
    src/main/php
    src/test/php
    src/test/resources

  In addition, in one or two tests got the following folder structure:

    src/test/php              <-- "test" folders are before "main"
    src/test/resources
    src/main/resources        <-- always before "src/main/php"
    src/main/php

In previous Eclipse setup (Indigo):

  No matter what, was getting the following folder structure:

    src/main/php
    src/main/resources 
    src/test/resources        <-- always before "src/test/php"
    src/test/php



My current Eclipse setup:

   Eclipse Java EE IDE for Web Developers.

      Version : Juno Service Release 1
      Build id: 20121004-1855
      64-Bit
   
   PHP Tool Integration Core                    1.6.0.R20111119000000	
   PHP Development Tools (PDT) SDK Feature      3.1.1.201209101312	

   Mac OS X 10.7.5
Comment 5 Zhongwei Zhao CLA 2013-01-29 22:22:33 EST
Can you send me your project,I can not reproduce this bug,so I think it is cased by your specific settings.
Comment 6 Zhongwei Zhao CLA 2013-01-29 22:23:12 EST
Created attachment 226291 [details]
screenshot
Comment 7 Aldrin Baroi CLA 2013-01-29 23:50:46 EST
Hi Zhongwei:

My project is hosted on Google Code.  You can check out the source (Eclipse Project) from the following link:

http://code.google.com/p/mediawiki-page-attachment/source/checkout

Sincerely yours,

Aldrin
Comment 8 Zhongwei Zhao CLA 2013-01-30 00:39:46 EST
Hi Aldrin,
Please the screenshot,I think it is right.
Comment 9 Zhongwei Zhao CLA 2013-01-30 00:40:22 EST
Created attachment 226295 [details]
screenshot
Comment 10 Zhongwei Zhao CLA 2013-01-30 00:40:40 EST
btw,which pdt version do you use?
Comment 11 Aldrin Baroi CLA 2013-01-31 04:15:31 EST
Hi Zhongwei:
 
PDT version is 3.1.1.201209101312

Attaching three (3) screen shots ( two for wrong sort order and one for all the installed components within Eclipse)

Aldrin
Comment 12 Aldrin Baroi CLA 2013-01-31 04:18:04 EST
Created attachment 226366 [details]
Sort is wrong #1
Comment 13 Aldrin Baroi CLA 2013-01-31 04:18:35 EST
Created attachment 226367 [details]
Sort is wrong #2
Comment 14 Aldrin Baroi CLA 2013-01-31 04:19:19 EST
Created attachment 226368 [details]
All the installed components within Eclipse
Comment 15 Nico Wagner CLA 2013-08-23 05:46:28 EDT
i'm not sure if this is relevant: new files & folders are not added to the build path. after adding them manually to the build path the code will be indexed (now i can use autocomplete), the order changes but is more jumbled than before.

Version: Kepler Release
Build id: 20130614-0229

PHP Tool Integration Core 1.6.0.R20111119000000
Comment 16 Ralph Moenchmeyer CLA 2013-08-25 16:26:22 EDT
(In reply to comment #3)
> it's  because some of the folders are excluded from the build path.
> we have decided to show first the buildpath directories and then list all
> others.
> 
> This can be turned into a feature request to enable it.

Not true. I changed an old project accordingly and included it in the buildpath - it never gets the right ordering. 

But: 
New projects established with Eclipse Indigo 3.7 or Juno 4.3 show an alphabetic ordering. 

In any case: 
The limitations of the PHP explorer are annoying sometimes - although I like Eclipse for PHP otherwise very, very much .... 

I would like to see a PHP explorer which shows some selectable information associated with the directories/files in columns and which would give the user the chance of ordering according to the columns shown. Just as in Dreamweaver (although I regard it almost embarrassing to refer to a software from a world I do not like ...)
Comment 17 Ralph Moenchmeyer CLA 2013-08-25 16:29:19 EDT
(In reply to comment #15)
> i'm not sure if this is relevant: new files & folders are not added to the
> build path. after adding them manually to the build path the code will be
> indexed (now i can use autocomplete), the order changes but is more jumbled
> than before.
> 
> Version: Kepler Release
> Build id: 20130614-0229
> 
> PHP Tool Integration Core 1.6.0.R20111119000000

In my experience the "jumbling" is only true for old projects - but not for new ones set up under Juno 4.3. When I add new dirs/files manually to the build path in such projects alphabetical ordering happens. However, not for old projects which stem from the Indigo times.
Comment 18 Glen A. CLA 2015-10-10 10:55:20 EDT
I'm using Eclipse Mars.1 (4.5.1) with PDT 3.7.0.201510081354, and the folder ordering in two recently-created projects (as well as older projects) is not alphabetical.

I've tried messing around with the build path settings, with no success.

How do I fix this?
Comment 19 Glen A. CLA 2015-10-18 14:18:20 EDT
I can fix the order of folders that are on the build path by editing the ".buildpath" file, but this should happen automatically, and there should also be an option not to show build path folders first.
Comment 20 Eclipse Genie CLA 2016-05-27 15:34:39 EDT
New Gerrit change created: https://git.eclipse.org/r/73849
Comment 22 Dawid Pakula CLA 2016-05-30 03:38:23 EDT
"Show build path folders first" option isn't part of this bug.

Should be resolved via bug 179929
Comment 23 Sylvia Tancheva CLA 2016-06-17 07:26:36 EDT
Hi Dawid
I could not exactly understand (got a bit lost in this bug) - what is fixed, what is not, what is part of this bug and what should be part of another? :)
Comment 24 Dawid Pakula CLA 2016-06-17 07:37:11 EDT
Sure,

before my patch php explorer had files / folders added in two logical section:

1. Dirs (and its content) that are buildpaths roots (src/, app/, vendor/ ...)
2. Dirs/files that are outside build paths. Dirs always first + alphabetical.

This section are still actual but first section was sorted based on .buildpath order. This cause bug, when for example app/ was added after vendor/. As a result user had also vendor/ before app/ on list. This was fixed by me and sorting is alphabetical here.

Separate bug (bug 179929), is to have first and second section mixed.
Comment 25 Sylvia Tancheva CLA 2016-06-17 10:55:51 EDT
Thanks a lot! :)
Looks OK. Let's close it
Comment 26 Ralph Moenchmeyer CLA 2016-06-21 03:41:49 EDT
(In reply to Dawid Pakula from comment #24)

Many thanks also from a grateful PDT user. Good job!