Studio deletion creates orphans

Description

Steps to Reproduce

  1. Create a course in split modulestore (in devstack, create a course then create a rerun of the course)

  2. Create a new section, subsection, unit, and problem.

  3. Publish the unit.

  4. Delete the unit.

  5. Enter the Django shell: ./manage.py cms shell --settings=devstack

  6. In the Django shell, run these commands:

    (from https://gist.github.com/wedaly/0f0d40dcf037ab45de0d)

Expected Behavior

  • The problem is not returned by `modulestore().get_items()`

Actual Behavior

  • The problem is returned by `modulestore().get_items()` and has its parent set to None.

Notes

  • This has issue has led to an ugly workaround when searching the course tree for credit requirements in which we retrieve items, then go up the course tree until we find the root to check if the item is still available. It would be really nice to remove this to reduce the number of Mongo queries we need to make.

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Activity

Show:
Awais Jibran
September 19, 2015, 6:32 AM

As we were discussing about this, we were concerned that we're seeing this ItemNotFoundError error. we are concerned that there's a bug we're glossing over and we do not need to pass that exception. We can do it either way

1. Fix the fixture (We can discuss the amount of time and effort on this and who will be right person to take this on) and then continue
2. As we were discussing that chaining the base class might resolve the issue, can we also try that?

Let me know what you think. We can discuss it if you have any questions on Monday.

Adam Palay
August 18, 2015, 4:30 PM
Edited

Ah! Here's a case of something being an orphan in LMS but not in studio. and I were talking about this earlier today. Ali didn't know if these actually existed in the wild. Turns out they do

orphan/<course_id>+branch@published-branch
turns up one orphan

while
orphan/<course_id> is empty

Adam Palay
August 18, 2015, 4:27 PM
Edited

This is also bad because it's not being caught in the orphans handler— it's not showing up in /orphans/<course_id>

, looping you in

ChristinaR
August 18, 2015, 4:00 PM

I think it belongs in Platform because the split modulestore is not doing the right thing in delete_item.

Note that this is particularly bad for units that contain discussion modules, because orphaned discussion modules really screw up the forums.

willR
August 18, 2015, 3:57 PM

I wasn't sure whether to put this into T&L or Platform. what do you think?

Fixed

Assignee

hrazaR

Reporter

willR

Labels

Reach

None

Impact

None

Platform Area

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Platform Map Area (Levels 1 &amp; 2)

None

Platform Map Area (Levels 3 &amp; 4)

None

Priority

CAT-2