Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Assignment
-
Labels:None
-
Environment:Moodle 1.9.5+, PostgreSQL 8.3, Linux server
-
Database:PostgreSQL
-
Affected Branches:MOODLE_19_STABLE
Description
While trying to isolate where all certain assignment modules are currently being used I ran into the odd situation where I think there are orphaned tuples in the mdl_assignment table. Though I cannot verify it for all the orphans, it seems to be quite common when a backup and restore was done with the course. Here is the query I used to find mdl_module instances that don't have an associated md_course_module instance:
select ma.id, ma.course, ma.assignmenttype, ma.name, c.shortname
from mdl_assignment ma left join mdl_course c on ( ma.course = c.id)
where not exists (select 1
from mdl_course_modules cm
where cm.instance=ma.id
and cm.course=ma.course);
On my system this returns a list of 59 tuples, about half of which also don't have a valid entry in the mdl_course table (thus the left join above). Likewise there also appear to be at least resources as well which have no mdl_course_module associated with them.
I cannot find any way to access the mdl_assignment tuples represented by this query and an wondering if there isn't a bug somewhere that's creating or not properly deleting these tuples? Could these tuples be safe to delete?
Thanks for reporting this issue.
We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.
If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.
Michael d;
lqjjLKA0p6