core icon indicating copy to clipboard operation
core copied to clipboard

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

Open jcanup opened this issue 14 years ago • 20 comments

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

jcanup avatar Sep 20 '12 22:09 jcanup

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

jtesser avatar Sep 21 '12 00:09 jtesser

thx

jcanup avatar Sep 21 '12 19:09 jcanup

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

jtesser avatar Oct 16 '12 13:10 jtesser

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

jcanup avatar Oct 16 '12 15:10 jcanup

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 avatar Oct 16 '12 17:10 dotjorgeu

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

dotjorgeu avatar Oct 16 '12 17:10 dotjorgeu

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

jcanup avatar Oct 16 '12 18:10 jcanup

@jcanup what was the output of

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

jtesser avatar Oct 16 '12 18:10 jtesser

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

jcanup avatar Oct 16 '12 18:10 jcanup

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

jcanup avatar Oct 16 '12 18:10 jcanup

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

lad7 avatar Oct 16 '12 18:10 lad7

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

dotjorgeu avatar Oct 16 '12 20:10 dotjorgeu

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

lzhao1 avatar Oct 18 '12 15:10 lzhao1

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

dotjorgeu avatar Oct 18 '12 15:10 dotjorgeu

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

dotjorgeu avatar Oct 18 '12 15:10 dotjorgeu

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?

lzhao1 avatar Oct 18 '12 15:10 lzhao1

yes I do

dotjorgeu avatar Oct 18 '12 15:10 dotjorgeu

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

lzhao1 avatar Oct 18 '12 15:10 lzhao1

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.

dotjorgeu avatar Oct 18 '12 16:10 dotjorgeu