attachments not showing in alpha order

Heather Aluma asked on May 9, 2024 17:17

Good day. I am seeing something new with the attachments on one of our pages. It only seems to be happening on this one page. When you go to Properties --> Attachments to view, etc. the page's attachments, they are not showing up in complete alpha order. It's a pseudo alpha order where the alphabet starts at C, goes to the end and then starts again. The up and down arrows that allow you to change the order of the attachments still works.

The content editor who is working with this page has added a lot of PDF attachments. There are close to 160 and they range in size from your expected 100kb to 9 mb.

Why are things not automatically going into alpha order and how do I remedy it?

Correct Answer

Juraj Ondrus answered on May 10, 2024 06:16

The default sorting the alphabetical. But if someone changed the order using the arrows, then the new attachments are added at the top and the alphabetical order is not ensured - this would be a performance killer because you would need to go through all the attachments, find a place where to put it and then change the order value for all the rest of the attachments.
SO, check the CMS_Attachment table for this page (AttachmentDocumentID = your page ID and AttachmentIsUnsorted = 1). If the AttachmentOrder column has an integer number value, then this is used to determine the order. If it is null, alphabetical order is used. So, you can reset the values to null and then restart Kentico - now the attachments should be in alphabetical order again. And then tell the editors to not to use the sorting arrows :)

UPDATE [dbo].[CMS_Attachment]
   SET [AttachmentOrder] = null

 WHERE AttachmentDocumentID = XY
0 votesVote for this answer Unmark Correct answer

Recent Answers


Heather Aluma answered on May 10, 2024 15:35

Thank you!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.