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

Aperta
#326 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
JavaScript
Stelle
0
Fork
19
Merge medio
8h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openedx/xblocks-core

Tutte le issue di openedx/xblocks-core

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.