Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a57d92ecd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Contributor
There was a problem hiding this comment.
Pull request overview
ドキュメント管理・マネージャ内のTemplate Variable(TV)フォーム生成をテンプレートベースへ寄せ、PHP8環境での警告回避とURL型TVの保存・表示処理を更新する変更。
Changes:
- TV入力フォーム生成をテンプレートファイル(date/file/image/url)へ移行し、URL型TVのprefix/DocID対応を追加
- DocManager側TV一覧取得・描画処理を整理(JOIN/ORDER調整、caption/descriptionのエスケープ、共通renderFormElement利用)
- DocManagerのファイル/画像ブラウザ用JSをテンプレートへ集約、権限制御UIの変数初期化を修正
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| manager/includes/traits/document.parser.subparser.trait.php | TVレンダリング共通処理を更新(URL専用フォーム追加、dateフォームのform名対応、image/fileのエスケープ等) |
| manager/includes/docvars/inputform/form_url.tpl | URL型TV入力(prefix選択+入力欄)のテンプレート新設 |
| manager/includes/docvars/inputform/form_image.tpl | image入力のstyle属性受け渡し形式を調整 |
| manager/includes/docvars/inputform/form_file.tpl | file入力のstyle属性受け渡し形式を調整 |
| manager/includes/docvars/inputform/form_date.tpl | 日付クリア処理の参照フォーム名を動的化 |
| manager/actions/element/mutate_tmplvars.dynamic.php | TVアクセス権UIの変数初期化($chks/$notPublic)を修正 |
| manager/actions/element/mutate_module.dynamic.php | モジュールアクセス権UIの変数初期化($chks/$notPublic)を修正 |
| assets/modules/docmanager/tv.ajax.php | TV一覧取得クエリ・描画を更新し、共通tmplvarsレンダリングとエスケープを適用 |
| assets/modules/docmanager/templates/main.tpl | ファイル/画像ブラウザ呼び出しJSをテンプレート側へ集約 |
| assets/modules/docmanager/classes/dm_backend.class.php | URL型TVの保存処理をprefix/DocID対応へ更新 |
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.
https://forum.modx.jp/viewtopic.php?t=2036
概要
このPRの目的を日本語で記載してください。
This pull request introduces several improvements and refactorings to the handling and rendering of Template Variables (TVs) in the document manager module. The changes focus on modernizing the TV input rendering process by moving HTML markup into template files, enhancing security with better escaping, improving maintainability, and updating the logic for URL TVs. Additionally, there are minor fixes and code cleanups in related areas.
Key improvements and changes:
Template Variable (TV) Rendering Refactor
form_date.tpl,form_file.tpl,form_image.tpl,form_url.tpl). This improves maintainability and separation of concerns. [1] [2] [3] [4] [5]renderFormElementmethod to handle null or missing values more robustly and to ensure proper type casting for default text and elements.Security and Data Handling
hsc()) for TV captions and descriptions when rendering checkboxes, reducing the risk of XSS vulnerabilities.URL Template Variable Logic Update
JavaScript and UI Improvements
Minor Fixes and Cleanups
tv.ajax.phpfor more accurate TV listing and ordering.These changes collectively modernize the TV input system, improve security, and lay the groundwork for further enhancements.