Commit 891b473
authored
fix(contentstore): guard downstream_customized copy on paste (#38457)
Fix clipboard paste crash in upstream-link setup when pasted block does not expose `xml_attributes`.
Before change, paste flow always read `temp_xblock.xml_attributes["downstream_customized"]`. Blocks like `DragAndDropBlockWithMixins` do not have `xml_attributes`, so Studio raised `AttributeError` and paste failed.
Change now:
- Read `downstream_customized` from parsed block field first (`getattr(temp_xblock, "downstream_customized", [])`).
- Read `xml_attributes` only when block exposes it.
- Set `downstream_customized` only when block has field.1 parent e4f07e3 commit 891b473
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
513 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
514 | 524 | | |
515 | 525 | | |
516 | 526 | | |
| |||
0 commit comments