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

未关闭
#326 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start with xblock_video.block.VideoBlock.editor_saved() and compare it with cms.lib.xblock.upstream_sync.UpstreamSyncMixin.editor_saved(); the issue says the built-in video block has the same override. Find the Video tests covering editor saves and downstream sync, then add coverage showing a customized display_name survives an accepted library update. Done when that test passes and the video save still calls VideoConfigService.handle_editor_saved(...).

由索引模型根据 Issue 内容生成。

描述

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

主要语言
JavaScript
星标
0
派生
19
平均合并
8 小时
30 天内合并 PR
7

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openedx/xblocks-core 的其他 Issue

查看 openedx/xblocks-core 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。