Fix issue with threads order in learning paths when posting an answer - loosely refs CT#8004

1.10.x
Yannick Warnier 9 years ago
parent feab60e951
commit 072e0b4a8c
  1. 4
      main/forum/viewthread_flat.inc.php
  2. 5
      main/forum/viewthread_nested.inc.php

@ -20,7 +20,8 @@ $_user = api_get_user_info();
$userId = api_get_user_id();
$groupId = api_get_group_id();
$sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : 'ASC';
// Decide whether we show the latest post first
$sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : ($origin != 'learnpath' ? 'ASC' : 'DESC');
if (isset($current_thread['thread_id'])) {
$rows = getPosts($current_thread['thread_id'], $sortDirection);
@ -37,6 +38,7 @@ if (isset($current_thread['thread_id'])) {
if (!empty($rows)) {
$postCount = count($rows);
//$postCount = 1;
foreach ($rows as $row) {
if ($row['user_id'] == '0') {

@ -22,7 +22,8 @@ if (isset($_GET['action']) &&
delete_attachment(0, $_GET['id_attach']);
}
$sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : 'ASC';
// Decide whether we show the latest post first
$sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : ($origin != 'learnpath' ? 'ASC' : 'DESC');
$rows = getPosts($_GET['thread'], $sortDirection, true);
$count = 0;
@ -34,7 +35,7 @@ $sessionId = api_get_session_id();
$currentThread = get_thread_information($_GET['thread']);
$userId = api_get_user_id();
$postCount = count($rows);
$postCount = 1;
foreach ($rows as $post) {
// The style depends on the status of the message: approved or not.

Loading…
Cancel
Save