Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-24625 [META] global search block and indexing is broken , cron too.
  3. MDL-24822

access control for global search needs to be improved ( can't accomodate forum_discussions.groupid=-1 into block_serach_documents.groupid)

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • None
    • 2.0
    • Global search
    • None
    • MOODLE_20_STABLE

      from error :
      Default exception handler: Error writing to database Debug: Out of range value for column 'groupid' at row 1\nINSERT INTO mdl_block_search_documents (doctype,docid,itemtype,title,url,updated,docdate,courseid,groupid) VALUES(?,?,?,?,?,?,?,?,?)\narray (\n 0 => 'forum',\n 1 => '1',\n 2 => 'head',\n 3 => 'topic 1',\n 4 => 'http://aparup.moodle.local/m20/dev1/moodle/mod/forum/discuss.php?d=1#1',\n 5 => 1287986769,\n 6 => '1285729018',\n 7 => '12',\n 8 => '-1',\n)\n* line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown\n* line 816 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()\n* line 858 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()\n* line 244 of /search/indexlib.php: call to mysqli_native_moodle_database->insert_record()\n* line 165 of /search/indexer.php: call to IndexDBControl->addDocument()\n, referer: http://aparup.moodle.local/m20/dev1/moodle/search/stats.php

      adding some chit chat for posterity:

      aparup:
      mdl_forum_discussions.groupid: bigint(10) (signed) defaults to -1 ... is there a reason why this is? i'm seeing that groupid defaults to 0 elsewheres.

      skodak:
      backwards compatibility
      it was one of the first places that used groups 14:24

      aparup:
      hm so does -1 there mean 0 elsewhere? 14:26

      skodak:
      it is a bit more difficult, the forum group mode is something different than group mode in assignment for example
      in case of forum we track the origin of group where it was posted
      so 0 means all groups, -1 no group if I rememebr it correctly
      you need to read the code if you want to know exactly
      you may use the activity group mode for this too, the -1 looks like a kind of shortcut

      aparup:
      hm, i'm working on global search and getting
      Error writing to database Debug: Out of range value for column 'groupid' at row 1\nINSERT INTO mdl_block_search_documents
      wondering how i should populate this field
      MDL-24625 14:32

      skodak:
      search is using a completely wrong approach for dealing with access control, only activities know what these mean
      imo

      moodler:
      yeah, agreed
      it never should have had that info in the /search directory

            moodle.com Moodle HQ
            nebgor Aparup Banerjee
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.