Skip to content

Remove legacy XModule mixins from xblocks-contrib XBlocks #197

Closed
1 of 1 issue completed
Closed

Description

@irtazaakram

Description:

As per discussion here #151 (review)
XBlocks in xblocks-contrib still depend on old XModule-related mixins:

  • XModuleMixin - Remove usage in xblocks-contrib, no changes to edx-platform.
    • The methods should be removed from xblocks-contrib and all the test in this repo.
    • If we get test failures in edx-platform, let's discuss and fix forward. It may involve adding XModuleMixin to content libraries.
  • XModuleToXBlockMixin - Merge into each block using it.
  • XmlMixin - Add parse_xml method to problem block instead so we don't need this extra class.
  • RawMixin - Keep only the needed functions in the Problem block and remove the rest. Update any tests that need to be updated.

These are legacy implementations and add unnecessary technical debt.

We should refactor the affected XBlocks to remove any reliance on XModule-style internals and drop these mixins entirely from xblocks-contrib XBlocks.

Pre-requisite epic:

#125

Activity

  1. self-assigned this
    on Mar 16, 2026
  2. moved this to 🏗 In progress in Aximprovements Teamon Mar 16, 2026
  3. moved this from 🏗 In progress to 🛑 Blocked in Aximprovements Teamon Mar 26, 2026
  4. moved this from 🛑 Blocked to 🔖 Ready in Aximprovements Teamon Mar 30, 2026
  5. farhan commented on Apr 1, 2026

    @farhan
    Contributor

    As per discussion,

    @irtazaakram will start work on this epic for Problem XBlock and do the required changes on both xblocks-contrb/Problem Block and openedx-platform . Once it's done we will do the required work for the other blocks as well.

    In openedx-platform we are possibly going to attach XModuleMixin for the ContentLibrary runtime as well.

  6. moved this from 🔖 Ready to 🏗 In progress in Aximprovements Teamon Apr 2, 2026
  7. moved this from 🏗 In progress to 👀 In review in Aximprovements Teamon Apr 9, 2026
  8. moved this from 👀 In review to 🏗 In progress in Aximprovements Teamon Apr 15, 2026
  9. moved this from 🏗 In progress to 👀 In review in Aximprovements Teamon Apr 15, 2026
  10. moved this from 👀 In review to ✅ Done in Aximprovements Teamon Apr 21, 2026
  11. moved this from ✅ Done to 🔖 Ready in Aximprovements Teamon May 4, 2026
  12. kdmccormick commented on May 4, 2026

    @kdmccormick
    Member

    Reverted due to #243

    Reopening this so that we remember to fix and re-merge.

  13. self-assigned this
    on May 4, 2026
  14. kdmccormick commented on May 4, 2026

    @kdmccormick
    Member

    @farhan , thanks for finding this and reverting quickly in order to keep the bug out of Verawood. I looked into this a little bit, here's what I found:

    From #243 :

      File "/mnt/xblocks-contrib/xblocks_contrib/video/video.py", line 1219, in editable_metadata_fields
        editable_fields = super().editable_metadata_fields  # pylint: disable=no-member
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'super' object has no attribute 'editable_metadata_fields'
    

    VideoBlock has a property called editable_metadata_fields which is uses to compute the list of fields which should display for editing in Studio, used both in courses and in libraries. It calls super().editable_metadata_fields first, but since we removed XModuleMixin, there is no longer any base class implementation of this method.

    I think the things we need to do are:

    • Remove the super().editable_metadata_fields call from VideoBlock.editable_metadata_fields
    • Ensure VideoBlock.editable_metadata_fields still works without that super call. It might need new code added to the method now that its base implementation is gone.
    • Add a unit test so that VideoBlock.editable_metadata_fields is covered--it must not be covered now if we didn't see this error on the PR.
  15. farhan commented on May 13, 2026

    @farhan
    Contributor

    @kdmccormick Thanks for looking into it.

    VideoBlock has a property called editable_metadata_fields which is uses to compute the list of fields which should display for editing in Studio, used both in courses and in libraries. It calls super().editable_metadata_fields first, but since we removed XModuleMixin, there is no longer any base class implementation of this method.

    That's correct,

    • For lms/studio, it will work fine as platform attach XModuleMixin at run time.
    • For content-library, it will not work as we are not attaching XModuleMixin.

    Remove the super().editable_metadata_fields call from VideoBlock.editable_metadata_fields
    Ensure VideoBlock.editable_metadata_fields still works without that super call. It might need new code added to the method now that its base implementation is gone.

    Already done as references shared above. Code is well tested and has been shipped to verawood release.

    Add a unit test so that VideoBlock.editable_metadata_fields is covered--it must not be covered now if we didn't see this error on the PR.

    Good suggestion, I have created Vibe code generated WIP PR for it, will continue work on it.
    #248

  16. moved this from 🔖 Ready to 🏗 In progress in Aximprovements Teamon May 13, 2026
  17. moved this from 🏗 In progress to 👀 In review in Aximprovements Teamon May 25, 2026
  18. farhan commented on May 26, 2026

    @farhan
    Contributor

    Tests cases PR has been merged, closing the story
    #248

  19. moved this from 👀 In review to ✅ Done in Aximprovements Teamon May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions