diff --git a/ChangeLog b/ChangeLog index 59b7e9d87a..f50cbefdbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ phpMyAdmin - ChangeLog - issue #11826 Fix creating/editing VIEW with DEFINER containing special chars - issue #11828 Do not invoke FLUSH PRIVILEGES when server in --skip-grant-tables - issue #11804 Misleading message for configuration storage +- issue #11772 Table pagination does nothing when session expired 4.5.3.1 (2015-12-25) - issue #11774 Undefined offset 2 diff --git a/js/ajax.js b/js/ajax.js index d047173ea9..f24971a8da 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -488,19 +488,7 @@ var AJAX = { PMA_ajaxShowMessage(data.error, false); AJAX.active = false; AJAX.xhr = null; - if (parseInt(data.redirect_flag) == 1) { - // add one more GET param to display session expiry msg - if (window.location.href.indexOf('?') === -1) { - window.location.href += '?session_expired=1'; - } else { - window.location.href += '&session_expired=1'; - } - window.location.reload(); - } else if (parseInt(data.reload_flag) == 1) { - // remove the token param and reload - window.location.href = window.location.href.replace(/&?token=[^&#]*/g, ""); - window.location.reload(); - } + PMA_handleRedirectAndReload(data); if (data.fieldWithError) { $(':input.error').removeClass("error"); $('#'+data.fieldWithError).addClass("error"); diff --git a/js/functions.js b/js/functions.js index e3b192d049..2f30de4163 100644 --- a/js/functions.js +++ b/js/functions.js @@ -92,6 +92,27 @@ $.ajaxPrefilter(function (options, originalOptions, jqXHR) { } }); +/** + * Hanle redirect and reload flags send as part of AJAX requests + * + * @param data ajax response data + */ +function PMA_handleRedirectAndReload(data) { + if (parseInt(data.redirect_flag) == 1) { + // add one more GET param to display session expiry msg + if (window.location.href.indexOf('?') === -1) { + window.location.href += '?session_expired=1'; + } else { + window.location.href += '&session_expired=1'; + } + window.location.reload(); + } else if (parseInt(data.reload_flag) == 1) { + // remove the token param and reload + window.location.href = window.location.href.replace(/&?token=[^&#]*/g, ""); + window.location.reload(); + } +} + /** * Creates an SQL editor which supports auto completing etc. * diff --git a/js/navigation.js b/js/navigation.js index 12601f385f..2851ad48db 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -961,8 +961,8 @@ function PMA_navigationTreePagination($this) { } } $.post(url, params, function (data) { - PMA_ajaxRemoveMessage($msgbox); if (typeof data !== 'undefined' && data.success) { + PMA_ajaxRemoveMessage($msgbox); if (isDbSelector) { var val = PMA_fastFilter.getSearchClause(); $('#pma_navigation_tree') @@ -992,6 +992,7 @@ function PMA_navigationTreePagination($this) { } } else { PMA_ajaxShowMessage(data.error); + PMA_handleRedirectAndReload(data); } navTreeStateUpdate(); });