Commit 151b0d2e authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Errors when deleting forum post bug 1158086



- some cases the check of parent post throws an error
I believe this is due to '' being not the same as null

Change-Id: Ib2eb287f3e31c02a545b8b42afcbfb9b54ea3abd
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent c27b2fd3
......@@ -120,7 +120,7 @@ function deletepost_submit(Pieform $form, $values) {
$postrec = new stdClass();
$postrec->parent = $values['parent'];
do {
$postrec = get_record('interaction_forum_post', 'id', $postrec->parent, '', '', '', '', 'id, deleted, parent');
$postrec = get_record('interaction_forum_post', 'id', $postrec->parent, null, null, null, null, 'id, deleted, parent');
} while ($postrec && $postrec->deleted && $postrec->parent);
$redirecturl = get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $values['topic'];
if ($postrec && $postrec->parent) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment