I hope it’s not poor etiquette to jump in, but I’ve encountered the same issue as Guy. I followed the advice given in this thread and just updated to the latest build (EE 2.1.0, 20100810), but the problem persists.
I set up categories alphabetically originally, and when they displayed in cat_id order on my site, I tried switching to custom order to shuffle them, before switching back to alpha. However, my categories continue to display in cat_id order WHILE respecting parent/child relationships. Also like Guy’s case, in Control Panel all categories sort alphabetically and respect parent/child properly.
Following Guy’s lead, I looked at my database and sure enough all of my cat_order are now 1 (unless 1 is the correct value for alphabetical order, this seems to be the problem). Below is the output from my database, and in case it’s helpful in troubleshooting, here is a short explanation of my categories.
My top-level categories are set up as continents. Within continents are countries (as children of continents) and within some countries are regions (as children of countries). I entered most of the categories at once, but forgot a few countries (for example, Switzerland, Czech Republic, Hungary) and had to add them later. That’s when I noticed that the alphabetical sorting wasn’t working.
Here’s the relevant bit of my database. Notice the 1s all the way down the cat_order column.
INSERT INTO `exp_categories` (`cat_id`, `site_id`, `group_id`, `parent_id`, `cat_name`, `cat_url_title`, `cat_description`, `cat_image`, `cat_order`) VALUES
(1, 1, 1, 0, 'Africa', 'africa', '', '', 1),
(2, 1, 1, 0, 'Americas', 'americas', '', '', 1),
(3, 1, 1, 0, 'Antarctica', 'antarctica', '', '', 1),
(4, 1, 1, 0, 'Asia', 'asia', '', '', 1),
(5, 1, 1, 1, 'Morocco', 'morocco', '', '/public_html/images/uploads/flags/flags_gif/morocco.gif', 1),
(7, 1, 1, 1, 'South Africa', 'south_africa', '', '', 1),
(8, 1, 1, 2, 'Argentina', 'argentina', '', '', 1),
(9, 1, 1, 2, 'Brasil', 'brasil', '', '', 1),
(10, 1, 1, 1, 'Tunisia', 'tunisia', '', '', 1),
(11, 1, 1, 2, 'Canada', 'canada', '', '', 1),
(12, 1, 1, 2, 'Chile', 'chile', '', '', 1),
(13, 1, 1, 2, 'Colombia', 'colombia', '', '', 1),
(14, 1, 1, 2, 'Cuba', 'cuba', '', '', 1),
(15, 1, 1, 2, 'Mexico', 'mexico', '', '', 1),
(16, 1, 1, 2, 'United States', 'united_states', '', '', 1),
(17, 1, 1, 2, 'Uruguay', 'uruguay', '', '', 1),
(18, 1, 1, 4, 'China', 'china', '', '', 1),
(19, 1, 1, 4, 'Hong Kong, SAR China', 'hong_kong_sar_china', '', '', 1),
(20, 1, 1, 4, 'Macau, SAR China', 'macau_sar_china', '', '', 1),
(21, 1, 1, 4, 'Japan', 'japan', '', '', 1),
(22, 1, 1, 0, 'Middle East', 'middle_east', '', '', 1),
(23, 1, 1, 22, 'Qatar', 'qatar', '', '', 1),
(24, 1, 1, 0, 'Europe', 'europe', '', '', 1),
(25, 1, 1, 24, 'Austria', 'austria', '', '', 1),
(26, 1, 1, 24, 'Belgium', 'belgium', '', '', 1),
(27, 1, 1, 24, 'Bosnia i Hercegovina', 'bosnia_i_hercegovina', '', '', 1),
(28, 1, 1, 24, 'Bulgaria', 'bulgaria', '', '', 1),
(29, 1, 1, 24, 'Croatia', 'croatia', '', '', 1),
(30, 1, 1, 24, 'France', 'france', '', '', 1),
(31, 1, 1, 24, 'Germany', 'germany', '', '', 1),
(32, 1, 1, 24, 'Gibraltar', 'gibraltar', '', '', 1),
(33, 1, 1, 24, 'Greece', 'greece', '', '', 1),
(34, 1, 1, 24, 'Ireland', 'ireland', '', '', 1),
(35, 1, 1, 24, 'Italy', 'italy', '', '', 1),
(36, 1, 1, 24, 'Luxembourg', 'luxembourg', '', '', 1),
(37, 1, 1, 24, 'Macedonia', 'macedonia', '', '', 1),
(38, 1, 1, 24, 'Netherlands', 'netherlands', '', '', 1),
(39, 1, 1, 24, 'Romania', 'romania', '', '', 1),
(40, 1, 1, 24, 'Montenegro', 'montenegro', '', '', 1),
(41, 1, 1, 24, 'Serbia', 'serbia', '', '', 1),
(42, 1, 1, 24, 'Spain', 'spain', '', '', 1),
(43, 1, 1, 24, 'Turkey', 'turkey', '', '', 1),
(44, 1, 1, 24, 'Unclaimed Europe', 'unclaimed_europe', '', '', 1),
(45, 1, 1, 24, 'United Kingdom', 'united_kingdom', '', '', 1),
(46, 1, 1, 24, 'Switzerland', 'switzerland', '', '', 1),
(47, 1, 1, 24, 'Czech Republic', 'czech_republic', '', '', 1),
(48, 1, 1, 24, 'Hungary', 'hungary', '', '', 1),
(49, 1, 1, 0, 'Oceania', 'oceania', '', '', 1),
(50, 1, 1, 30, 'Paris', 'paris', '', '', 1),
(51, 1, 1, 8, 'Tierra del Fuego', 'tierra_del_fuego', '', '', 1),
(52, 1, 1, 8, 'Buenos Aires', 'buenos_aires', '', '', 1),
(53, 1, 1, 8, 'Mendoza', 'mendoza', '', '', 1),
(54, 1, 1, 28, 'Sofia', 'sofia', '', '', 1),
(55, 1, 1, 28, 'Northwest Bulgaria', 'northwest_bulgaria', '', '', 1),
(56, 1, 1, 28, 'Southwest Bulgaria', 'southwest_bulgaria', '', '', 1),
(57, 1, 1, 28, 'Central Bulgaria', 'central_bulgaria', '', '', 1),
(58, 1, 1, 28, 'Bulgaria''s Black Sea Coast', 'bulgarias_black_sea_coast', '', '', 1),
(59, 1, 1, 29, 'Dubrovnik', 'dubrovnik', '', '', 1),
(60, 1, 1, 29, 'Adriatic islands', 'adriatic_islands', '', '', 1),
(61, 1, 1, 16, 'New York', 'new_york', '', '', 1);
Also, just in case anyone is thinking of recommending it, I don’t want to manually edit the cat_id numbers. I will be adding more regularly, and this has to work at the system level.
I’d love to hear what’s happened with Guy’s categories when he updates to the latest build.