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

Đang mở
#326 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

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(...).

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
0
Fork
19
Merge trung bình
8 giờ
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openedx/xblocks-core

Tất cả issue của openedx/xblocks-core

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.