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

Processing module function assignment_cron: Object to string conversion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.1, 1.8
    • Component/s: Assignment (2.2)
    • Labels:
      None
    • Environment:
      Moodle 1.7+ (2006101009)
      uname -a:
      Linux secure4.ia-dns.com 2.4.21-40.ELsmp #1 SMP Thu Feb 2 22:22:39 EST 2006 i686 i686 i386 GNU/Linux

      Upgraded Jan 4 from Moodle 1.5.? to 1.6 to 1.7+
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      Error in cron:

      Processing module function assignment_cron ...Processing assignment submission 3714
      <br />
      <b>Notice</b>: Object to string conversion in <b>PATH/moodle/mod/assignment/lib.php</b> on line <b>1764</b><br />
      <br />
      <b>Notice</b>: Undefined variable: Object in <b>PATH/moodle/mod/assignment/lib.php</b> on line <b>1764</b><br />
      <div class="notifytiny" align="center">Error: Invalid context creation request for level "50", instance "".</div><br />
      <div class="notifytiny" align="center">Incorrect context parameter "" for has_capability(), object expected! This should be fixed in code.</div><br />
      STUDENT not an active participant in COURSE

      I've used all caps for words I've replaced, and I have moodle in debug mode so I see the most errors.

      Process to create:
      Restored a course into new course
      Enrolled three students (made sure one had entered the course at least once)
      Opened an assignment (visibile=show type=offline activity) (The above steps may work the same in a new course/assignment: I have not verified)
      View Submissions
      Give students a grade and a comment (no special characters: just plain text)
      Save all my feedback
      Run cron by opening page: URL/moodle/admin/cron.php
      Receive the above error.

      Code in question:

      if (!has_capability('moodle/course:view', get_context_instance(CONTEXT_COURSE, $$submission->course)))

      { echo fullname($user)." not an active participant in $course->shortname\n"; continue; }

        Attachments

          Activity

            People

            • Assignee:
              skodak Petr Skoda
              Reporter:
              sgifford Solomon Gifford
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/Jan/07