We're updating the issue view to help you get more done. 

xmodule field_data_cache should be cleared when student data is loaded

Description

If you access student specific fields on a module descriptor (e.g. 'position') before the module itself is loaded, accessing the module's properties later might be invalid.

In particular, in x_module.py:bind_for_student
we should add
self._field_data_cache.clear()
after
self._field_data = field_data

Reproduction steps:
1. Set a breakpoint at https://github.com/edx/edx-platform/blob/37d965d6a71372c894b48d979a4c1af2efdbbf93/lms/djangoapps/courseware/views.py#L360
2. Print "course.position"
3. Observe "None" since the user data isn't loaded.
4. Set a breakpoint at https://github.com/edx/edx-platform/blob/37d965d6a71372c894b48d979a4c1af2efdbbf93/lms/djangoapps/courseware/views.py#L364
5. Print "course_module.position"
6. Observer "None" even though the user data should now be loaded.

If you don't do step 2 then the correct behavior occurs

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Status

Assignee

Unassigned

Reporter

akivaR

Labels

Reach

None

Impact

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Stakeholders

None

Story Points

1

Sprint

None

Priority

CAT-3