← Back to team overview

mahara-contributors team mailing list archive

[Bug 1222995] [NEW] delete forum post gives errors

 

Public bug reported:

On trying to delete a forum post I get the below errors. I suspect it is
to do with the having parent deleted also.

The offending bit of code looks to be:

    do {
        $postrec = get_record('interaction_forum_post', 'id', $postrec->parent, '', '', '', '', 'id, deleted, parent');
    } while ($postrec && $postrec->deleted && $postrec->parent);

The forum post does however get deleted.

-----------------------------------------------------------------------------

[WAR] a6 (lib/errors.php:749) Failed to get a recordset: postgres7 error: [-1: ERROR:  bind message supplies 3 parameters, but prepared statement "" requires 1] in EXECUTE("SELECT id, deleted, parent FROM "interaction_forum_post"  WHERE "id" = ?  LIMIT 2")
Command was: SELECT id, deleted, parent FROM "interaction_forum_post"  WHERE "id" = ?  and values was (1,,)
Call stack (most recent first):

    log_message("Failed to get a recordset: postgres7 error: [-1: E...", 8, true, true) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/errors.php:109
    log_warn("Failed to get a recordset: postgres7 error: [-1: E...") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/errors.php:749
    SQLException->__construct("Failed to get a recordset: postgres7 error: [-1: E...") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/dml.php:492
    get_recordset_sql("SELECT id, deleted, parent FROM "interaction_forum...", array(size 3), 0, 2) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/dml.php:333
    get_record_sql("SELECT id, deleted, parent FROM "interaction_forum...", array(size 3)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/dml.php:310
    get_record("interaction_forum_post", "id", "1", "", "", "", "", "id, deleted, parent") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/interaction/forum/deletepost.php:123
    deletepost_submit(object(Pieform), array(size 5)) at Unknown:0
    call_user_func_array("deletepost_submit", array(size 2)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:528
    Pieform->__construct(array(size 4)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:170
    Pieform::process(array(size 4)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 4)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/interaction/forum/deletepost.php:108

** Affects: mahara
     Importance: Undecided
         Status: Triaged

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1222995

Title:
  delete forum post gives errors

Status in Mahara ePortfolio:
  Triaged

Bug description:
  On trying to delete a forum post I get the below errors. I suspect it
  is to do with the having parent deleted also.

  The offending bit of code looks to be:

      do {
          $postrec = get_record('interaction_forum_post', 'id', $postrec->parent, '', '', '', '', 'id, deleted, parent');
      } while ($postrec && $postrec->deleted && $postrec->parent);

  The forum post does however get deleted.

  -----------------------------------------------------------------------------

  [WAR] a6 (lib/errors.php:749) Failed to get a recordset: postgres7 error: [-1: ERROR:  bind message supplies 3 parameters, but prepared statement "" requires 1] in EXECUTE("SELECT id, deleted, parent FROM "interaction_forum_post"  WHERE "id" = ?  LIMIT 2")
  Command was: SELECT id, deleted, parent FROM "interaction_forum_post"  WHERE "id" = ?  and values was (1,,)
  Call stack (most recent first):

      log_message("Failed to get a recordset: postgres7 error: [-1: E...", 8, true, true) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/errors.php:109
      log_warn("Failed to get a recordset: postgres7 error: [-1: E...") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/errors.php:749
      SQLException->__construct("Failed to get a recordset: postgres7 error: [-1: E...") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/dml.php:492
      get_recordset_sql("SELECT id, deleted, parent FROM "interaction_forum...", array(size 3), 0, 2) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/dml.php:333
      get_record_sql("SELECT id, deleted, parent FROM "interaction_forum...", array(size 3)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/dml.php:310
      get_record("interaction_forum_post", "id", "1", "", "", "", "", "id, deleted, parent") at /home/robertl/htdocs/mahara-testing/mahara/htdocs/interaction/forum/deletepost.php:123
      deletepost_submit(object(Pieform), array(size 5)) at Unknown:0
      call_user_func_array("deletepost_submit", array(size 2)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:528
      Pieform->__construct(array(size 4)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:170
      Pieform::process(array(size 4)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/lib/pieforms/pieform.php:71
      pieform(array(size 4)) at /home/robertl/htdocs/mahara-testing/mahara/htdocs/interaction/forum/deletepost.php:108

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1222995/+subscriptions


Follow ups

References