fix(tvs): handle deprecated and missing TV input types - #89
Open
Ibochkarev wants to merge 4 commits into
Open
Conversation
- Add setup upgrade scripts for 3.2.1-pl (textareamini → textarea migration) - Update GetInputs.php and modTemplateVar.php for deprecated TV types
Rewrite getRender with early returns so empty output no longer re-includes render classes, drop getResolvedRenderType, migrate textareamini via the shared deprecated map on 3.3.0-pl, and add regression tests.
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.
Что сделано
Останавливает fatal менеджера, когда TV ещё указывает на удалённый или deprecated input-тип. Перемаппим известные остатки (сейчас:
textareamini→textarea), прячем эти ключи из пикера input-типа, а если render-файл просто исчез, фолбэчим на textarea (input) или text (output).getRender()перемаппивает deprecated input-типы, грузит зарегистрированный класс только когда он существует, затем пробует render-файл, затем фолбэк. Пустой output реального render остаётся пустым; мы не трактуем это как «попробуй снова».Setup-скрипт
3.3.0-plобходитmodTemplateVar::getDeprecatedInputTypes()и переписывает хранимые типы в БД.Зачем нужно
Редактирование ресурса взрывалось, когда render-класс типа TV отсутствовал — классический случай после удаления кастомного TV-экстра или остаточный
textareamini. Issue хочет без fatal и textarea-фолбэк, чтобы многострочные значения выживали.Refs modxcms#13077.
Как проверить
textareaminiв БД (или оставьте старый).textareaminiне должен появиться в списке input-типов.textareaminiдолжны статьtextarea.modTemplateVarTest(deprecated map, fallback render, empty registered output).Связанные
Оригинал: modxcms#16832