Pass a default into User::getPref() when trying to retrieve the comments mode set so users with no comment mode set will default to 'threaded'. Otherwise these users won't see any comments.
This commit is contained in:
@@ -368,7 +368,7 @@ function view_app_comments($versionId, $threadId = 0)
|
|||||||
if (isset($_REQUEST['cmode']))
|
if (isset($_REQUEST['cmode']))
|
||||||
$_SESSION['current']->setPref("comments:mode", $_REQUEST['cmode']);
|
$_SESSION['current']->setPref("comments:mode", $_REQUEST['cmode']);
|
||||||
|
|
||||||
$sel[$_SESSION['current']->getPref("comments:mode")] = 'selected';
|
$sel[$_SESSION['current']->getPref("comments:mode", "threaded")] = 'selected';
|
||||||
echo '<td><form method="post" name="smode" action="appview.php">',"\n";
|
echo '<td><form method="post" name="smode" action="appview.php">',"\n";
|
||||||
echo "<b>Application Comments</b> $messageCount total comments ";
|
echo "<b>Application Comments</b> $messageCount total comments ";
|
||||||
echo '<b>Mode</b> <select name="cmode" onchange="document.smode.submit();">',"\n";
|
echo '<b>Mode</b> <select name="cmode" onchange="document.smode.submit();">',"\n";
|
||||||
@@ -402,7 +402,7 @@ function view_app_comments($versionId, $threadId = 0)
|
|||||||
|
|
||||||
//hide or display depending on pref
|
//hide or display depending on pref
|
||||||
if ($_SESSION['current']->isLoggedIn())
|
if ($_SESSION['current']->isLoggedIn())
|
||||||
$mode = $_SESSION['current']->getPref("comments:mode");
|
$mode = $_SESSION['current']->getPref("comments:mode", "threaded");
|
||||||
else
|
else
|
||||||
$mode = "threaded"; /* default non-logged in users to threaded comment display mode */
|
$mode = "threaded"; /* default non-logged in users to threaded comment display mode */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user