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

Notice: Undefined property: stdClass::$userid in moodle20\mod\forum\db\upgrade.php on line 144

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Installation
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      This notice is happen in upgrading procedures from Moodle1.9+ to Moodle2.0.
      Perhaps, userid informations are lost.

      --(Using $post>userid , here)-----
      if (!$fs->file_exists($context->id, $filearea, $post->id, '/', $filename)) {
      $file_record = array('contextid'=>$context->id, 'filearea'=>$filearea, 'itemid'=>$post->id, 'filepath'=>'/', 'filename'=>$filename, 'userid'=>$post->userid);

      ---(Obtaining records from db, here)----
      $sqlfrom = "FROM

      {forum_posts}

      p
      JOIN

      {forum_discussions}

      d ON d.id = p.discussion
      JOIN

      {forum}

      f ON f.id = d.forum
      JOIN

      {modules}

      m ON m.name = 'forum'
      JOIN

      {course_modules}

      cm ON (cm.module = m.id AND cm.instance = f.id)
      WHERE p.attachment <> '$empty' AND p.attachment <> '1'";

      $count = $DB->count_records_sql("SELECT COUNT('x') $sqlfrom");

      if ($rs = $DB->get_recordset_sql("SELECT p.id, p.attachment, d.forum, f.course, cm.id AS cmid $sqlfrom ORDER BY f.course, f.id, d.id")) {

      ------
      There is not p.userid in SELECT. It's a cause of thie notice.

        Attachments

          Activity

            People

            • Assignee:
              danmarsden Dan Marsden
              Reporter:
              shirai Tatsuya Shirai
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10