fix(context): Assign TV media source when creating new context - #87
Open
Ibochkarev wants to merge 1 commit into
Open
fix(context): Assign TV media source when creating new context#87Ibochkarev wants to merge 1 commit into
Ibochkarev wants to merge 1 commit into
Conversation
When a new context is created, materialize default_media_source rows in media_sources_elements for TVs that already have bindings. Uses one INSERT…SELECT so large sites avoid N+1, matches the Manager TV UI fallback, and does not copy custom sources (Duplicate already does that). Fixes modxcms#9058
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
После создания нового контекста TV, у которых уже есть media source в другом контексте, выглядели связанными в Manager, но в
media_sources_elementsне было строки для нового контекста. Фронт baseUrl и компания игнорировали source, пока вы не пересохраняли TV.Create контекста теперь вставляет строку
default_media_sourceдля каждого TV, у которого уже есть хотя бы одна привязка. ОдинINSERT…SELECTделает работу (без per-TV N+1). Кастомные source остаются где были; Context Duplicate по-прежнему копирует их.Зачем нужно
Без строки БД UI TV лгал, а новый контекст не использовал media source до ручного re-save. #9058 открыт с 2012 за этот мисматч.
Как проверить
web).webне скопирован; новая строка используетdefault_media_source.Связанные
Refs modxcms#9058
Оригинал: modxcms#16834