Fixed Improper Array In Fetch Options When Accessing Forum Index

Snog

Well-known member
#1
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..
Code:
Array ( [0] => last_post_date [1] => DESC )
It should be this...
Code:
Array ( [order] => last_post_date [orderDirection] => DESC )
This causes anything using the proper array ($fetchOptions['order']) to error out.
 
Last edited:

Chris D

XenForo developer
Staff member
#2
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.
 

Snog

Well-known member
#3
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:
Top