Skip to content

fix(tvs): handle deprecated and missing TV input types - #89

Open
Ibochkarev wants to merge 4 commits into
3.xfrom
3.2.1-upgrade-tvs-deprecated-types
Open

fix(tvs): handle deprecated and missing TV input types#89
Ibochkarev wants to merge 4 commits into
3.xfrom
3.2.1-upgrade-tvs-deprecated-types

Conversation

@Ibochkarev

@Ibochkarev Ibochkarev commented Aug 21, 2026

Copy link
Copy Markdown
Member

Что сделано

Останавливает fatal менеджера, когда TV ещё указывает на удалённый или deprecated input-тип. Перемаппим известные остатки (сейчас: textareaminitextarea), прячем эти ключи из пикера 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.

Как проверить

  1. Поставьте тип TV в textareamini в БД (или оставьте старый).
  2. Откройте ресурс, использующий его — менеджер должен грузиться; TV должен рендериться как textarea.
  3. Создайте/отредактируйте TV — textareamini не должен появиться в списке input-типов.
  4. Направьте TV на фейковый тип без render-файла — то же: без fatal, textarea-фолбэк.
  5. Запустите апгрейд до 3.3.0 — строки с textareamini должны стать textarea.
  6. Опционально: запустите modTemplateVarTest (deprecated map, fallback render, empty registered output).

Связанные

Оригинал: modxcms#16832

- 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.
@Ibochkarev Ibochkarev changed the title fix(tvs): обработка deprecated и отсутствующих TV input-типов fix(tvs): handle deprecated and missing TV input types Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant