1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Search loses grouping in URL when change user

Discussion in 'Resolved Bug Reports' started by Jon W, Jul 1, 2014.

  1. Jon W

    Jon W Well-Known Member

    If a user shares a search link that includes grouping (i.e., group discussions as threads), when a different user then follows they link, they get a link that doesn't include the grouping. Even though this doesn't affect the results immediately, if they then shared this link, the grouping would be lost.

    For example:
    http://xenforo.com/community/search/5355539/?q=grouping&t=post&o=relevance&g=1

    Notice that the &g=1 disappears.

    The problem is because the $existingSearch variable is used in XenForo_ControllerPublic_Search:
    PHP:
            return $searchModel->insertSearch(
                
    $results$search['search_type'], $search['search_query'], $constraints,
                
    $search['search_order'], $existingSearch['search_grouping'], $userResults,
                
    $searcher->getWarnings(), $visitorUserId
            
    );
    This variable is always false. The correct code is:
    PHP:
            return $searchModel->insertSearch(
                
    $results$search['search_type'], $search['search_query'], $constraints,
                
    $search['search_order'], $search['search_grouping'], $userResults,
                
    $searcher->getWarnings(), $visitorUserId
            
    );
     
  2. Mike

    Mike XenForo Developer Staff Member

    Fixed, thanks.
     
    Jon W likes this.

Share This Page