Skip to content

Video: course-side title override of a library-synced Video is lost on sync (editor_saved doesn't call super) #326

Open

Description

@irfanuddinahmad

Summary

For a Video reused from a Content Library V2 into a course, a course-side title override is overwritten by the next sync from the library. The same flow keeps the override for HTML, Word Cloud, LTI and Problem.

Steps to reproduce

Found while smoke-testing openedx/openedx-platform#38750 on a local Tutor nightly (platform master base + xblocks-core 2.0.0):

  1. Publish a Video in a V2 library and reuse it in a course unit (Library content).
  2. In the course, change the reused copy's display name to "Course override".
  3. In the library, rename the video and publish.
  4. Accept the update in the course (POST /api/contentstore/v2/downstreams/<usage>/sync).

Expected: "Course override" is kept (display_name is customizable by default).
Actual: the title becomes the library's new name.

Cause

The platform mixes cms.lib.xblock.upstream_sync.UpstreamSyncMixin into every XBlock (XBLOCK_MIXINS). Its editor_saved() records customized fields in downstream_customized. xblock_video.block.VideoBlock.editor_saved() overrides it and only calls VideoConfigService.handle_editor_saved(...), never super().editor_saved(...). So for a mixed Video class, editor_saved resolves to VideoBlock.editor_saved, and the override is never recorded. For HTML it resolves to UpstreamSyncMixin.editor_saved (checked in a CMS shell).

This predates the extraction: the built-in xmodule/video_block/video_block.py::editor_saved is identical.

Suggested fix

Call super().editor_saved(user, old_metadata, old_content) from VideoBlock.editor_saved (when the parent defines it), plus a test that a customized display_name survives a sync.

| Generated using Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions