Repository navigation
fix(managermanager): mm_renameField などのラベル操作ルールを rc の編集画面に対応 - #478
Conversation
1.2.0J で編集画面のラベルが span.warning から span.mutate-field-title に 変わり、ラベルを探す mm_renameField / mm_hideFields(menuindex) / mm_requireFields / mm_ddMaxLength / mm_ddGMap が要素を見つけられなく なっていた。 あわせて、フレーム廃止後は frames/menu.php が同じリクエスト内で 読み込まれるため、topmenu_site が未保存のサイトでは buildMenu() が $modx->config を既定値で丸ごと上書きし、ManagerManager 本体が base_path を参照できず編集画面の描画が止まっていた。不足分だけを 補うように変更する。 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01715QYq9MrhezVezp8WXJs6
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: modxcms-jp/evolution-jp/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughManagerManagerの各ウィジェットが参照するラベル要素を更新しました。 ChangesManagerManager修正
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No concrete merge-blocking risk remains in the reviewed changes. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Missing individual topmenu_* defaults are not restored when topmenu_site remains present.
Review effort: Lite
Findings: None
What changed in this PR
Updates ManagerManager label rules for the current resource editor DOM and preserves configuration during menu generation.
Changes:
- Updates label selectors and
menuindexrow traversal. - Fixes field-name display for validation and map widgets.
- Preserves existing configuration while applying menu defaults.
| File | Reviewed change |
|---|---|
manager/frames/menu.php |
Updates menu configuration fallback handling. |
assets/plugins/managermanager/widgets/mm_requirefields/mm_requirefields.php |
Updates required-field labels and validation messages. |
assets/plugins/managermanager/widgets/mm_renamefield/mm_renamefield.php |
Updates label selectors and row lookup. |
assets/plugins/managermanager/widgets/mm_hidefields/mm_hidefields.php |
Updates field and label hiding behavior. |
assets/plugins/managermanager/widgets/ddmaxlength/ddmaxlength.php |
Fixes validation field-name display. |
assets/plugins/managermanager/widgets/ddgmap/ddgmap.php |
Fixes map heading field-name display. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
概要
mm_rulesのmm_renameField()が効かない不具合を直します。同じ原因で壊れていた他の mm_* ルールもあわせて直します。原因
2 つあります。
編集画面の行テンプレートでラベルが
span.warningからspan.mutate-field-titleに変わりました(f70e7938f, 39a8d48)。ウィジェットはspan.warningを探していたため、要素が見つからず何も起きていませんでした。$modx->configが既定値で丸ごと上書きされる(1.3.0rc)フレーム廃止で
frames/menu.phpが同じリクエスト内で読み込まれるようになりました。buildMenu()はtopmenu_siteが無いと$modx->config = $default_config;で config を差し替えるため、システム設定を一度も保存していないサイトでは ManagerManager 本体が$modx->config['base_path']を参照できずに PHP 警告が出て、編集画面の描画が止まっていました。変更内容
mm_renameField/mm_hideFields/mm_requireFields/mm_ddMaxLength/mm_ddGMap: ラベルのセレクタをspan.mutate-field-titleに変更mm_renameField/mm_hideFieldsの menuindex: 入れ子テーブル前提の辿り方をやめ、closest("tr.mutate-field-row")で行を特定mm_renameField('content'): 出力 JS の行末にセミコロンを追加frames/menu.php: config を差し替えずに、足りないキーだけを既定値で補う(+=)影響範囲
mm_renameFieldcontent以外すべて効かないmm_hideFields('menuindex')mm_requireFieldsmm_ddMaxLengthmm_ddGMapmm_changeFieldHelp/mm_renameTab/mm_renameSection/mm_createTab/mm_moveFieldsToTabは元から動いていることを確認しました(変更なし)。menu.phpの修正は ManagerManager 以外にも効きます。これまで該当サイトでは、シェル表示のページで DB のシステム設定がすべて既定値で上書きされていました(例: friendly URL の設定が編集画面の alias 欄に反映されていなかった)。確認手順
mm_rulesチャンクに次を書き、キャッシュをクリアする*が付くことを確認するtopmenu_*をsystem_settingsから削除した状態(新規インストール直後相当)でも、編集画面が最後まで描画されてルールが効くことを確認するPlaywright(Chromium)とローカルの Docker 環境(1.3.0rc1 を新規インストール、デモコンテンツ入り)で上記をすべて確認しました。
Closes #476
🤖 Generated with Claude Code
https://claude.ai/code/session_01715QYq9MrhezVezp8WXJs6
Summary by CodeRabbit