Opened 4 years ago
Last modified 4 years ago
#5846 new defect (bug)
WPTV: Subtitle attachment info stays even after subtitle file is removed
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Component: | WordPress.tv | Keywords: | |
| Cc: |
Description (last modified by )
When an approved subtitle file is deleted, it remains as approved subtitles. Because of this, a new file for the same language can't be uploaded.
Steps to reproduce:
- Upload a subtitle file
- Approve that subtitles
- Delete the subtitle file (WITHOUT unchecking ”approved”)
- The video still displays the subtitle language on the frontend sidebar, but if you click the language link you get an error:
LOCALE is not a supported language(e.g. see the English (Canada) link, attached to this video) - Also, from the backend of the video's attachment information, the subtitle seems not selected. In the example case above, the English (Canada) subtitle attachment ID value is 0 (admin link).
Expected behavior:
When an approved subtitle file is deleted, WPTV should consider that the video no longer has subtitles for the language.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Just noting that I've cleaned some up manually:
https://wordpress.tv/2021/06/03/shusei-toda-block-editor-02-text-blocks/
wp> $subtitles = get_post_meta( 108717, '_videopress_subtitles', true ); => array(3) { ["ja"]=> array(2) { ["language"]=> string(2) "ja" ["subtitles_post_id"]=> int(108792) } ["en"]=> array(2) { ["language"]=> string(2) "en" ["subtitles_post_id"]=> int(109539) } ["en-ca"]=> array(2) { ["language"]=> string(5) "en-ca" ["subtitles_post_id"]=> int(109540) } } wp> unset( $subtitles['en-ca'] ); wp> update_post_meta( 108717, '_videopress_subtitles', $subtitles ); => bool(true)https://wordpress.tv/2021/02/06/muhammad-muhsin-introduction-to-wordpress/
wp> $subtitles = get_post_meta( 107951, '_videopress_subtitles', true ); => array(1) { ["en"]=> array(2) { ["language"]=> string(2) "en" ["subtitles_post_id"]=> int(107954) } } wp> unset( $subtitles['en'] ); wp> update_post_meta( 107951, '_videopress_subtitles', $subtitles ); => bool(true)