Skip to content

Remove XModuleMixin legacy attributes from extracted blocks #125

@kdmccormick

Description

@kdmccormick

The XModuleMixin in edx-platform defines legacy backwards-compatibility properties.

  • The mixin is dynamically added to all LMS XBlocks for modulestore, and CMS blocks for modulestore as well. This means that the mixin is added to all blocks in courses and legacy libraries. We need to do this because modulestore-based code uses these legacy attributes.
  • The mixin is NOT added to Learning Core. This means that the mixin is NOT added to blocks for V2 libraries. This is on purpose, so that we don't rely on the legacy attributes in learning-core-based code.

XBlocks themselves should not to define these legacy attributes (other than display_name, which is special and should be defined on every block).

We added some of those legacy attributes to WordCloud in order to get it working in Libraries V2. That will work for now. But, the right fix is to find out where the legacy attributes were being called in libraries V2, and then fix those references of the legacy attributes. For example, if Libraries V2 code is calling .location, then it should be changed to .usage_key instead. Then, these legacy attributes can be removed from WordCloud.

The same approach should be taken for any other extracted block that hits this issue.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicLarge unit of work, consisting of multiple tasks

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions