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

Fixed Improper Array In Fetch Options When Accessing Forum Index

Discussion in 'Resolved Bug Reports' started by Snog, Jul 9, 2015.

  1. Snog

    Snog Well-Known Member

    This is for 1.5 Beta 1

    When accessing the forum index page, the thread fetch options have an improper array causing the default actions in /XenForo/Model/Thread.php to take place.

    The array contained in the fetchoptions is this..
    Array ( [0] => last_post_date [1] => DESC )
    It should be this...
    Array ( [order] => last_post_date [orderDirection] => DESC )
    This causes anything using the proper array ($fetchOptions['order']) to error out.
    Last edited: Jul 9, 2015
  2. Chris D

    Chris D XenForo Developer Staff Member

    This is changed now thank you.

    I actually can't get it to "error out" nor have we seen any errors as a result. Actually, despite the mistake, the code works exactly as intended hence why it has gone unnoticed in the testing up to now.

    If you are seeing actual errors as a result, this may be down to some other code extending the fetch options code.

    Regardless, fixed in Beta 2 and the actual fix is just to specify the order as 'last_post_date'. The descending order direction will happen automatcially if it is not specified.
  3. Snog

    Snog Well-Known Member

    Yes it is from an add-on extending the fetch options. That's how it was found. Looking for and checking the contents of $fetchOptions['order']. ;)

    Thanks for the quick fix!
    Last edited: Jul 9, 2015
    Chris D likes this.
  4. Snog

    Snog Well-Known Member

    Just an FYI, I tested the fix in forum.php(actionIndex) and it works.
    Chris D likes this.

Share This Page