Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Recommend42] セッションの有効期限が切れているか使用できない場合、表示エラーによりログイン ページが表示されます。くなる 不具合の修正 #62

Open
wants to merge 1 commit into
base: 4.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Resource/locale/messages.ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ plugin_recommend.admin.edit.existed: この商品はすでにおすすめ商品
plugin_recommend.admin.edit.search: 商品の追加
plugin_recommend.admin.edit.product_search.header: 商品検索
plugin_recommend.admin.edit.product_search.button: 検索

plugin_recommend.admin.common.failed_to_load: 読み込みに失敗しました
11 changes: 9 additions & 2 deletions Resource/template/admin/regist.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
);

$('#searchProductModalButton').on('click', function() {
var xhr = new XMLHttpRequest();
var list = $('#searchProductModalList');
list.children().remove();
$.ajax({
Expand All @@ -46,11 +47,17 @@
'id' : $('#admin_search_product_id').val(),
'category_id' : $('#admin_search_product_category_id').val()
},
xhr: function() {
return xhr;
},
url: '{{ url('plugin_recommend_search_product') }}',
success: function(data) {
// モーダルに結果を書き出し.
$('#searchProductModalList').html(data);

if (xhr.responseURL === '{{ url('admin_login') }}') {
alert('{{ 'plugin_recommend.admin.common.failed_to_load'|trans }}');
} else {
$('#searchProductModalList').html(data);
}
},
error: function() {
alert('Search product failed.');
Expand Down