XF 2.0 Can't view forums

fotografik

Active member
I am getting the following error when trying to view a forum sub-category.

InvalidArgumentException: Unknown order by direction THREA in src/XF/Mvc/Entity/Finder.php at line 930
  1. XF\Mvc\Entity\Finder->setDefaultOrder() in src/XF/Finder/Thread.php at line 75
  2. XF\Finder\Thread->applyForumDefaultOrder() in src/XF/Finder/Thread.php at line 18
  3. XF\Finder\Thread->inForum() in src/XF/Repository/Thread.php at line 14
  4. XF\Repository\Thread->findThreadsForForumView() in src/XF/Pub/Controller/Forum.php at line 205
  5. XF\Pub\Controller\Forum->actionForum() in src/XF/Mvc/Dispatcher.php at line 249
  6. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1880
  9. XF\App->run() in src/XF.php at line 328
  10. XF::runApp() in index.php at line 13
I can view threads, members, but not forums.
 
That seems like it's caused by an add-on, or by invalid data in the database. You may be able to workaround it by editing each forum and checking the default sort order and direction are what you want (and then saving).

Given a previous error that you mentioned, is this an import? If so, then this may be a bug with the import.
 
This was an upgrade from an XF1.5.16 dataset which was imported from a VB4 forum. After the VB to XF1.5 import, I ran the users, forums and thread rebuilds and could see all the data. I do note that the forums default view was set wrongly and didn't go through each forum sub-category to re-set.

No add-ons were installed other than the stock XF add-ons - ElasticSearch and Media Gallery.
 
That seems like it's caused by an add-on, or by invalid data in the database. You may be able to workaround it by editing each forum and checking the default sort order and direction are what you want (and then saving)
Hi Mike,

Is there an SQL command that can be run to set the following defaults for all nodes in XF2?

Disable Moderate Replies
Enable Count messages posted in this forum toward user total
Enable Include threads from this forum when users click "New. posts"
Set Forum Watch Notication Limts to New Messages
Default Sort Order Last Message | Descending

We are doing another trial migration from VB4 > CF1.5 > XF2.0 and it would be useful to be able to set all the above with an SQL query instead of manually editing 200+ forum nodes. Thank you in advance for any assistance.
 
Hi Mike,

Is there an SQL command that can be run to set the following defaults for all nodes in XF2?

Disable Moderate Replies
Enable Count messages posted in this forum toward user total
Enable Include threads from this forum when users click "New. posts"
Set Forum Watch Notication Limts to New Messages
Default Sort Order Last Message | Descending

We are doing another trial migration from VB4 > CF1.5 > XF2.0 and it would be useful to be able to set all the above with an SQL query instead of manually editing 200+ forum nodes. Thank you in advance for any assistance.

Hi XenForo Devs or Mods,

Would like to know if this is possible. Thanks!
 
SQL:
UPDATE xf_forum SET moderate_replies = 0, count_messages = 1, find_new = 1, default_sort_order = 'last_post_data', default_sort_direction = 'desc', allowed_watch_notifications = 'all'

I believe that should do what you want but I'd wait for a dev to confim it.

You would also most likely have to edit and save at least one node to rebuild the cache after running the query. (I am presuming it's cached but I do not know for certain)
 
Last edited:
SQL:
UPDATE xf_forum SET moderate_replies = 0, count_messages = 1, find_new = 1, default_sort_order = 'last_post_data', default_sort_direction = 'desc', allowed_watch_notifications = 'all'

I believe that should do what you want but I'd wait for a dev to confim it.

You would also most likely have to edit and save at least one node to rebuild the cache after running the query. (I am presuming it's cached but I do not know for certain)
Thanks Bryan, will wait for confirmation from Devs.
 
Back
Top Bottom