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

Blog Association to Course causes Error [[invalidcontextid]]

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.2.1
    • Blog
    • None
    • MySQL
    • MOODLE_22_STABLE
    • Hide

      In my Opinion there is a mistake in the validation()-Method in blog/edit_form.php (about line: 137);

      To get the coursecontext validation() uses:

      $coursecontext = get_context_instance(CONTEXT_COURSE, $data['courseassoc']);

      but $data['courseassoc'] holds the id of the context not the courseid.

      The correct line should be: $coursecontext = get_context_instance(CONTEXT_COURSE, $data['courseid']);

      Another opportunity would be to retrieve the context-object by context-id: get_context_instance_by_id($data['courseassoc']);

      Show
      In my Opinion there is a mistake in the validation()-Method in blog/edit_form.php (about line: 137); To get the coursecontext validation() uses: $coursecontext = get_context_instance(CONTEXT_COURSE, $data ['courseassoc'] ); but $data ['courseassoc'] holds the id of the context not the courseid. The correct line should be: $coursecontext = get_context_instance(CONTEXT_COURSE, $data ['courseid'] ); Another opportunity would be to retrieve the context-object by context-id: get_context_instance_by_id($data ['courseassoc'] );
    • Hide

      Just create a Blogentry in Coursecontext. Formvalidation causes a invalidcontextid - Error.

      Show
      Just create a Blogentry in Coursecontext. Formvalidation causes a invalidcontextid - Error.

      It is not possible to associate a blog to a coursecontext.

            moodle.com Moodle HQ
            wagner139 Andreas Wagner
            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.