dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
866 stars 467 forks source link

Folders not alphabetized in Add/Edit Link drop-down list #1198

Closed jcanup closed 12 years ago

jcanup commented 12 years ago

Folders are alphabetized in host view, I'd expect them to be alphabetized everywhere. Here's the example: https://xfiles.uth.tmc.edu/Users/jcanup/dotCMS%202.1.1/DOTCMS-7422-not-alphabetized.jpg

jtesser commented 12 years ago

yea this one has been around a while. Almost everyone uses the website browser to do this so it goes unnoticed. I will make for the next patch

jcanup commented 12 years ago

thx

jtesser commented 12 years ago

Jorge RaviT said he couldn't reproduce this but I think it is because he was on windows.

jcanup commented 12 years ago

I'm on Windows so I don't that that's the issue.

dotjorgeu commented 12 years ago

Hard to reproduce this one. That's because we see starter site were every folder has same value for title and name. In the query we sort by folder.title. Then in code we take that and sort by name. So, if your data have differences between titles and names on folders you will see this unsorted.

Show us the output of this query:

 select name,title from folder where name<>title;
dotjorgeu commented 12 years ago

mmm thinking more on this... hey @jcanup maybe you have any hotfix plugin rewriting that code. That's a possibility.

jcanup commented 12 years ago

all hotfixes were removed in this upgrade process... so no.

jtesser commented 12 years ago

@jcanup what was the output of

select name,title from folder where name<>title;

jcanup commented 12 years ago

I'll have to get our DBA to pull that info for you.

jcanup commented 12 years ago

After your description of how this is sorted, I went back to Website --> Browser to look at the folder listing. They way you're sorting it now, those folder names are not longer in alpha order either... not an improvement. Why would you show one thing but sort by another? I don't understand the logic in that. https://xfiles.uth.tmc.edu/Users/jcanup/dotcms-foldernames.jpg https://xfiles.uth.tmc.edu/Users/jcanup/dotcms-foldernames-detail.jpg

lad7 commented 12 years ago

There are 1,095 records so I am just going to post what is shown in the screen shot: name title celebration A Celebration of Transformation and Hope ........ uth-big CCTS Biomedical Informatics Group

dotjorgeu commented 12 years ago

@jcanup please run this JSP on your server. Edit line 11 with your hostname to test http://pastebin.com/id5mPTez

lzhao1 commented 12 years ago

We ran the script on our server. According to Lad, it didn't seem to do anything.

dotjorgeu commented 12 years ago

yes because you need to edit line 11 with the host name where you wanna run it

dotjorgeu commented 12 years ago

anyway it is only a diagnostic JSP. It doesn't make any change. I only need to get its output

lzhao1 commented 12 years ago

ok, i did edit line 11 to our host name. It did have a list of output displayed in the browser. Do you need it?

dotjorgeu commented 12 years ago

yes I do

lzhao1 commented 12 years ago

what's your email address? I can send it to you. Can't attach anything here.

dotjorgeu commented 12 years ago

jorge.urdaneta@dotcms.com

dotjorgeu commented 12 years ago

ok I have your input. Lets follow it.

1) The list order by folder.title: unordered. That's ok 2) The list order by folder.name with collections.sort: ordered. Thats what we do at the API. That's ok 3) APILocator.getFolderAPI().findSubFolders(host): unordered. That's wrong. It means you're running a different code.

Here is the code for 2.2 --> https://github.com/dotCMS/dotCMS/blob/2.2/src/com/dotmarketing/portlets/folders/business/FolderFactoryImpl.java#L1351

And for 2.1 --> https://github.com/dotCMS/dotCMS/blob/2.1/src/com/dotmarketing/portlets/folders/business/FolderFactoryImpl.java#L1351

In that API we get from db then we do a manual sort. That works on the JSP (see 2). You must be running old code. Maybe hotfix plugins not cleared correctly. I have seen that before. Check your dotCMS/WEB-INF/classes directory for that class (FolderFactoryImpl.class). It should not be there. Maybe we can help you with that in a EE ticket.

Ok so this is not a bug. Closing this one.