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

Course tags block causes errors on oracle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.1.5, 2.2.2
    • 2.2, 2.3
    • Tags
    • Linux
    • Oracle
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MDL-31806-master
    • Hide

      Issue is to be in the following query

      File => /tag/coursetaglib.php
      Function => coursetag_get_all_tags()

      Query=>

      SELECT id, name, id, tagtype, rawname, f.timemodified, flag, count
      FROM e_tag t,
      (SELECT tagid, MAX(timemodified) as timemodified, COUNT(id) as count
      FROM e_tag_instance WHERE tagid NOT IN
      (SELECT tagid FROM e_tag_instance ti, e_course c
      WHERE c.visible = 0
      AND ti.itemtype = 'course'
      AND ti.itemid = c.id)
      GROUP BY tagid) f
      WHERE t.id = f.tagid
      ORDER BY count DESC, name ASC

      Oracle does not allow same name in select query (SELECT id, name, id) so place an alias for one of the id say

      SELECT id as t_id, name, id, tagtype, rawname, f.timemodified, flag, count
      FROM e_tag t,
      (SELECT tagid, MAX(timemodified) as timemodified, COUNT(id) as count
      FROM e_tag_instance WHERE tagid NOT IN
      (SELECT tagid FROM e_tag_instance ti, e_course c
      WHERE c.visible = 0
      AND ti.itemtype = 'course'
      AND ti.itemid = c.id)
      GROUP BY tagid) f
      WHERE t.id = f.tagid
      ORDER BY count DESC, name ASC

      Show
      Issue is to be in the following query File => /tag/coursetaglib.php Function => coursetag_get_all_tags() Query=> SELECT id, name, id, tagtype, rawname, f.timemodified, flag, count FROM e_tag t, (SELECT tagid, MAX(timemodified) as timemodified, COUNT(id) as count FROM e_tag_instance WHERE tagid NOT IN (SELECT tagid FROM e_tag_instance ti, e_course c WHERE c.visible = 0 AND ti.itemtype = 'course' AND ti.itemid = c.id) GROUP BY tagid) f WHERE t.id = f.tagid ORDER BY count DESC, name ASC Oracle does not allow same name in select query (SELECT id, name, id) so place an alias for one of the id say SELECT id as t_id, name, id, tagtype, rawname, f.timemodified, flag, count FROM e_tag t, (SELECT tagid, MAX(timemodified) as timemodified, COUNT(id) as count FROM e_tag_instance WHERE tagid NOT IN (SELECT tagid FROM e_tag_instance ti, e_course c WHERE c.visible = 0 AND ti.itemtype = 'course' AND ti.itemid = c.id) GROUP BY tagid) f WHERE t.id = f.tagid ORDER BY count DESC, name ASC
    • Hide

      Steps to reproduce:
      1) Go to Admin > Plugins > Blocks > Tags and enable 'show course tags'
      2) Navigate to course home page
      4) Add tag block to course
      5) Refresh the page

      Expected result:
      Tag block displayed and no errors

      Actual result:
      DB Error ORA-00918 - column ambigiously defined

      Show
      Steps to reproduce: 1) Go to Admin > Plugins > Blocks > Tags and enable 'show course tags' 2) Navigate to course home page 4) Add tag block to course 5) Refresh the page Expected result: Tag block displayed and no errors Actual result: DB Error ORA-00918 - column ambigiously defined

      When a teacher tries to click "Enrolled users" link under course administration then the page displays "Error reading from database" if a tag block is added with course tags enabled.

      • line 125 of /tag/coursetagslib.php: call to oci_native_moodle_database->get_records_sql()
      • line 115 of /blocks/tags/block_tags.php: call to coursetag_get_all_tags()
      • line 280 of /blocks/moodleblock.class.php: call to block_tags->get_content()
      • line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      • line 926 of /lib/blocklib.php: call to block_base->get_content_for_output()
      • line 978 of /lib/blocklib.php: call to block_manager->create_block_contents()
      • line 349 of /lib/blocklib.php: call to block_manager->ensure_content_created()

      SELECT id, name, id, tagtype, rawname, f.timemodified, flag, count
      FROM e_tag t,
      (SELECT tagid, MAX(timemodified) as timemodified, COUNT(id) as count
      FROM e_tag_instance WHERE tagid NOT IN
      (SELECT tagid FROM e_tag_instance ti, e_course c
      WHERE c.visible = 0
      AND ti.itemtype = 'course'
      AND ti.itemid = c.id)
      GROUP BY tagid) f
      WHERE t.id = f.tagid
      ORDER BY count DESC, name ASC

            cfulton Charles Fulton
            bharadvaj Bharadvaj
            Dan Poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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