Changing chapter name in XML breaks preview button in Studio

Steps to Reproduce

1. Go to unit (this an MITx test course): https://studio.edge.edx.org/container/block-v1:MITx+S101+2015_T1+type@vertical+block@e9ec465f8bc949ae930ad5d8047e6e81
2. Press Preview

Expected behavior: would see content
Actual Behavior: page not found

See orphans: https://studio.edge.edx.org/orphan/course-v1:MITx+S101+2015_T1

To create in a fresh course:

1.) Export course
2.) Change chapter file name ex. (0c1ec994774145e1a11d82d108e68203.xml to changed.xml)
3.) Change course.xml reference ex. (url_name="0c1ec994774145e1a11d82d108e68203" to url_name="changed")
4.) Import course
5.) Go to Studio and click on preview

LMS is fine, and you can navigate to the unit on preview.edx.org.

Sandbox: http://studio-jumpto.sandbox.edx.org

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Activity

Show:
Awais Jibran
October 13, 2015, 7:00 AM

PR#9862 is merged, please verify and close this.
Thanks.

Awais Jibran
October 6, 2015, 10:32 AM
Edited

Update
we are not fix this for old mongo as a part of this Ticket/PR; & saving it for another, lower-priority ticket. For now it's much more important to patch this for split mongo.
PR#9862

Awais Jibran
October 2, 2015, 11:07 AM

Update
I have updated the PR#9862 with `mongo` implementation as well. Mongo uses cache, so I have added a method to check if the selected parent is valid or not (going to the top of the course root). If any orphan found do not fetch the parent from they cache but check it from the `collection`. Any xblock is not an orphan If parents are `None` and `block_type` is in `['course', 'library']`.

Awais Jibran
October 1, 2015, 3:27 PM

Update
Worked for mongo module store.
The Mongo has slightly a different way of dealing when you try to fetch the parents of item. The method uses cache. If an component has been updated with orphan parent, the cache is updated and it only returns a single parent (Which possibly can be an orphan).

I tried one solution where i checked the selected parent from cache is in course orphans or not, but i think that would be an expensive call because we would be checking alot more non-orphan parents.

Still not sure on what bases I need to unset the cache for that particular component because there are components like overview , info etc which does not have a parents. I will discuss this within team tomorrow and checkout whats the better way of dealing with it.

Awais Jibran
September 30, 2015, 5:11 PM

I have changed the logic for filtering out the orphans. Previously I tried of getting the course_orphan & filtering orphan parents & grand-parents. Now using a recursive method, it verifies that if an xblock has a path to the root or not. It return Boolean whether or not a xblock has path to the course root.

Fixed

Assignee

Awais Jibran

Reporter

Shelby Quinn

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 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Priority

CAT-2