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

chat cron does not work in mysql

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Chat
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      the problem is again:
      You can't specify target table 'mdl_chat_messages' for update in FROM clause - 243 of mod/chat/lib.php

      $sql = "SELECT m.id
      FROM {$CFG->prefix}chat_messages m
      JOIN {$CFG->prefix}chat c
      ON m.chatid = c.id
      WHERE c.keepdays != 0
      AND m.timestamp < ( ".time()." - c.keepdays * 24 * 3600)";

      delete_records_select("chat_messages", "id IN ($sql)");

      return true;

      solution: rewrite in portable SQL

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Mar/08