Results 1 to 2 of 2

Thread: 6.1.x email sort order bug?

  1. #1
    arthur.k is offline Member
    Join Date
    Jan 2011
    Posts
    6

    Default 6.1.x email sort order bug?

    Hello Sugar gurus.

    Having an issue with out 6.1.3 setup..

    When clicking an email inbox, emails are sorted properly - newest on first page, and older on the sub-sequent pages.

    HOWEVER, when user clicks on page 2 or other page, the sort order gets Reversed. If we click the Date button a couple times, the emails get resorted properly and 2nd, 3rd, page work on, but initially when a user clicks on another page, the sort order becomes backwards.

    I did check the listviewhome.php in the modules/Emails and it shows

    $ListView->setQuery($where, '', 'date_sent, date_entered DESC', "EMAIL");

    which is correct. So why would the order get reversed after clicking 2nd page?

    Thank you for your help!

  2. #2
    arthur.k is offline Member
    Join Date
    Jan 2011
    Posts
    6

    Default Re: 6.1.x email sort order bug?

    Thanks to a knowledgable community member on here this has been fixed. I'm certain someone else has been bound to come across this issue, so here is a fix (not upgrade safe)

    sugarcrm/modules/InboundEmail/InboundEmail.php
    // cache
    $ret = array();
    $cacheUsed = false;
    if($forceRefresh == 'false' && $this->validCacheExists($this->mailbox)) {
    $emailSettings = $current_user->getPreference('emailSettings', 'Emails');

    // cn: default to a low number until user specifies otherwise
    if(empty($emailSettings['showNumInList'])) {
    $emailSettings['showNumInList'] = 20;
    }

    //*****THIS IS THE FIX: modification to address issue where email list wasn't sorting correctly
    $sort = 'date';
    $direction = 'desc';
    //*****END OF THE FIX

    $ret = $this->getCacheValue($this->mailbox, $emailSettings['showNumInList'], $page, $sort, $direction);
    $cacheUsed = true;
    }

    $out = $this->displayFetchedSortedListXML($ret, $mbox);

    $metadata = array();
    $metadata['mbox'] = $mbox;
    $metadata['ieId'] = $this->id;
    $metadata['name'] = $this->name;
    $metadata['fromCache'] = $cacheUsed ? 1 : 0;
    $metadata['out'] = $out;

    return $metadata;
    }

    /**
    * For a group email account, create subscriptions for all users associated with the
    works good now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. sort order of get_linked_beans
    By mikesolomon in forum Developer Help
    Replies: 6
    Last Post: 2011-11-05, 11:25 AM
  2. leads sort order by name
    By sigarffs in forum General Discussion
    Replies: 2
    Last Post: 2007-06-27, 09:35 PM
  3. My Mailbox Sort order
    By alsutton in forum Help
    Replies: 13
    Last Post: 2006-04-27, 04:19 AM
  4. History Sort Order
    By andreasw in forum Help
    Replies: 10
    Last Post: 2005-10-22, 11:13 AM
  5. Bug is Sort Order of History Items
    By trueblade in forum General Discussion
    Replies: 0
    Last Post: 2005-07-25, 03:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •