Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-6517

Adding or editing post produces "ERROR: invalid input syntax for integer: "Object id #XXX"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.6.3, 1.7
    • 1.6.1
    • Forum
    • None
    • Slackware, Apache 2.2.3, PHP 5.1.6, Moodle 1.6.1+, post.php revision 1.94.2.6
    • PostgreSQL
    • MOODLE_16_STABLE
    • MOODLE_16_STABLE, MOODLE_17_STABLE

      I have noticed an error message when adding or updating a post to the site news. The message was:

      ERROR: invalid input syntax for integer: "Object id #246"
      SELECT type FROM mdl_forum WHERE id = 'Object id #246'

      IMHO there is a bug in the mod/forum/post.php. I have patched it as follows:

      $ cvs diff post.php
      Index: post.php
      ===================================================================
      RCS file: /cvsroot/moodle/moodle/mod/forum/post.php,v
      retrieving revision 1.94.2.6
      diff -c -r1.94.2.6 post.php

          • post.php 31 Jul 2006 10:04:18 -0000 1.94.2.6
          • post.php 11 Sep 2006 15:01:51 -0000
            ***************
          • 136,142 ****

      $message = '';

      ! if (get_field('forum', 'type', 'id', $forum) == 'news' && !$oldpost->parent) {
      $updatediscussion = new object;
      $updatediscussion->id = $oldpost->discussion;
      if (empty($post->timestartdisabled)) {
      — 136,142 ----

      $message = '';

      ! if (get_field('forum', 'type', 'id', $forum->id) == 'news' && !$oldpost->parent) {
      $updatediscussion = new object;
      $updatediscussion->id = $oldpost->discussion;
      if (empty($post->timestartdisabled))

      { *************** *** 274,280 **** }

      $newstopic = false;
      ! if (get_field('forum', 'type', 'id', $forum) == 'news')

      { $newstopic = true; }
      if ($newstopic && empty($post->timestartdisabled)) { --- 274,280 ---- }

      $newstopic = false;
      ! if (get_field('forum', 'type', 'id', $forum->id) == 'news') { $newstopic = true; }

      if ($newstopic && empty($post->timestartdisabled)) {

            vyshane Vy-Shane Sin Fat (Inactive)
            mudrd8mz David Mudrák (@mudrd8mz)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.