マスタ編集画面を開くと誤ってテーブル編集画面に遷移してしまうため修正#4482
Merged
Merged
Conversation
Collaborator
|
@IwasakiRyuichi ありがとうございます、マージしますね |
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.
@ryuring
概要
カスタムコンテンツの関連フィールド編集画面(詳細編集)で「マスタ編集」ボタンを押すと、マスターとなるカスタムフィールドの編集画面へ遷移することを期待していましたが、元のカスタムコンテンツのテーブル編集画面に戻ってしまう不具合を修正しました。
原因
plugins/bc-admin-third/templates/plugin/BcCustomContent/Admin/element/CustomLinks/form.phpの「マスタ編集」リンクが、<a>タグに静的なhref=""と Vue の:href="editFieldLinkUrl"を重複していました。Vue3の仕様では、同一要素に同名属性が重複した場合、先に出力される静的な属性を優先し、後で指定したものは無視する仕様です。さらに、静的な
hrefに空文字を渡すと、CakePHPのRouter::url('')は「現在のリクエストURL」を返す仕様のため、リンクは常に今開いているテーブル編集画面自身を指したまま固定されていました。plugins/bc-admin-third/templates/plugin/BcCustomContent/Admin/element/CustomLinks/form.php修正内容
<a>タグ(BcBaser->link())をやめ、type="button"の<button>要素に変更し、クリック時にVueメソッドeditField(custom_tables/form.js)を呼び出す形にしました。editField内で確認ダイアログを表示した上で、location.hrefによりマスターとなるカスタムフィールドの編集画面に遷移させています。ご確認お願いします。