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

Moodle Cron issue with tag instances of wiki pages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Wiki (2.x)
    • Labels:
      None
    • Environment:
      Linux,PSQL,2.0 Preview 4+ (Build: 20100907) and 2.0 RC1 (Build: 20101020)
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      When running the cron process there is several tag instances that reference itemtype as wiki_page. This has created this error below. I replaced the entries with wiki_pages per to fix it :-

      update mdl_tag_instance set itemtype='wiki_pages' where itemtype='wiki_page';

      Default exception handler: Error reading from database Debug: ERROR: relation "mdl_wiki_page" does not exist
      LINE 1: SELECT 'x' FROM mdl_wiki_page WHERE id = $1 LIMIT 1 OFFSET 0
      ^
      SELECT 'x' FROM mdl_wiki_page WHERE id = $1 LIMIT 1 OFFSET 0
      [array (
      0 => '1',
      )]

      • line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
      • line 229 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      • line 631 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      • line 1540 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_recordset_sql()
      • line 1525 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
      • line 1509 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select()
      • line 770 of /tag/lib.php: call to moodle_database->record_exists()
      • line 877 of /tag/lib.php: call to tag_cleanup()
      • line 313 of /lib/cronlib.php: call to tag_cron()
      • line 61 of /admin/cli/cron.php: call to cron_run()

      The upgrade of wiki may need to be fixed to.

      diff --git a/mod/wiki/db/upgrade.php b/mod/wiki/db/upgrade.php
      index d133392..962f3f6 100644
      — a/mod/wiki/db/upgrade.php
      +++ b/mod/wiki/db/upgrade.php
      @@ -321,7 +321,7 @@ function xmldb_wiki_upgrade($oldversion) {
      $DB->execute($sql);

      $sql = "UPDATE

      {tag_instance}
      • SET itemtype = 'wiki_page'
        + SET itemtype = 'wiki_pages'
        WHERE itemtype = 'wiki'";
        $DB->execute($sql);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dongsheng Dongsheng Cai
                Reporter:
                tlock Tim Lock
                Tester:
                Nobody
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

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