ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Categories not displaying in alphabetical order

August 12, 2010 2:14pm

Subscribe [6]
  • #16 / Aug 23, 2010 10:59am

    cwatts

    13 posts

    I’ve not had a chance to work with it yet.  I assumed it wasn’t a host issue, seeing as how Eric is using Engine Hosting.

    Chris

  • #17 / Aug 23, 2010 11:51am

    eguystephens

    90 posts

    Chris - what hosting provider are you using?

  • #18 / Aug 23, 2010 11:55am

    cwatts

    13 posts

    I use InMotion Hosting and have not had any hosting-related problems with EE thus far.

    Chris

  • #19 / Aug 24, 2010 1:59am

    John Henry Donovan

    12339 posts

    Guy,
    please check your email

  • #20 / Aug 24, 2010 5:49pm

    Robin Sowell

    13255 posts

    erfi75- I dropped you an email, would like to take a closer look at one of these.  Like John Henry- I can’t replicate.  I believe I’ve spotted the code in question- I’ll post at the end for the curious.  But that said- it should be changing that ‘1’ for the sort order as it cycles through.  It does for mine.  The fact the server seems to be in play is even more curious.  Nothing in the code really suggests that would be the case.

    Anyway- we’re working on getting this cleared up for you folks.  Sorry for the delay.

    And for the uber-geeks:

    foreach($query->result_array() as $row)
            {        
                $this->cat_update[$row['cat_id']]  = array($row['parent_id'], '1', $row['cat_name']);
            }
             
            $order = 0;
            
            foreach($this->cat_update as $key => $val) 
            {
                if (0 == $val['0'])
                {    
                    $order++;
                    $this->cat_update[$key]['1'] = $order;
                    $this->process_subcategories($key);  // Sends parent_id
                }
            }
  • #21 / Aug 24, 2010 7:12pm

    Robin Sowell

    13255 posts

    K- erfi75, I’m not as up on your data and such as you are.  But how’s it look now?  Just looking at the db table, I’m getting changes like I’d expect- where I wasn’t before.  But some conformation by someone else would be handy.

  • #22 / Aug 24, 2010 7:26pm

    erfi75

    34 posts

    Hi Robin,

    Yes, the categories do seem to be displaying alphabetically now (definitely different from what I was getting before).

    May I ask, how’d you do that?!

    Thanks,
    Eric

  • #23 / Aug 24, 2010 7:58pm

    eguystephens

    90 posts

    Yes I’d like to know what you did too and what others having the issue need to do?

    Thanks!

    Guy

  • #24 / Aug 24, 2010 10:36pm

    Robin Sowell

    13255 posts

    😉  Sorry- had to run to dog class.

    I was thinking it was possibly a php 4 issue- but erfi75 is running 5.1.6, so….  I need to poke still to figure out why it fails.  It’s not immediately obvious to me.  But- process of elimination- for now I tweaked the process_category_group (in system/ee/controllers/cp/admin_content.php) a la:

    $this->process_subcategories($key);  // Sends parent_id
    changed to 
    $this->process_subcategories($key, $this->cat_update);  // Sends parent_id

    Then the process_subcategories changed to:

    function process_subcategories($parent_id, $carray)
    {
        if ( ! $this->cp->allowed_group('can_access_admin') OR ! $this->cp->allowed_group('can_access_content_prefs'))
        {
            show_error($this->lang->line('unauthorized_access'));
        }
            
        $order = 0;
    
        foreach($carray as $key => $val) 
        {
            if ($parent_id == $val['0'])
            {
                $order++;
                $this->cat_update[$key]['1'] = $order;                                                
                $this->process_subcategories($key, $this->cat_update);
            }
        }
    }

    I want to poke it in the morning so I’m firm on why the original code had issues.  But we’ll definitely get a fix in for this.  I just like knowing exactly why it flaked out before I commit it.

    And thanks for the test environment, erfi75.  Saved loads of time.

  • #25 / Aug 25, 2010 10:27am

    eguystephens

    90 posts

    Will this be rolled into a future build - and will someone let us know when it is available?

    Thanks!

    Guy

  • #26 / Aug 25, 2010 8:19pm

    Brandon Jones

    5500 posts

    Guy, once the final fix is determined this will be in a future build.

  • #27 / Aug 25, 2010 8:41pm

    eguystephens

    90 posts

    Thanks - I appreciate all the help from the EE team!

    Guy

  • #28 / Aug 25, 2010 9:22pm

    Robin Sowell

    13255 posts

    Was a weird one!  And yep- we’ll get a formal fix in.

  • #29 / Aug 27, 2010 7:15am

    erfi75

    34 posts

    Thanks to everyone involved in noticing and troubleshooting this issue. I’m happy to hear that it’s being resolved in a future build.

    Cheers,
    Eric

  • #30 / Aug 27, 2010 9:11am

    Ingmar

    29245 posts

    Thank you for you contribution, everybody. Please don’t hesitate to post again in case there’s anything else.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases