Merge pull request #15058 from mauriciofauth/fix-create-edit-view

Fix bug when creating or editing views
This commit is contained in:
Maurício Meneghini Fauth 2019-03-21 03:34:31 -03:00 committed by GitHub
commit 832a0e986e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -1761,6 +1761,7 @@ class Util
if (($url_length > $GLOBALS['cfg']['LinkLengthLimit'])
|| ! $in_suhosin_limits
|| strpos($url, 'sql_query=') !== false
|| strpos($url, 'view[as]=') !== false
) {
$parts = explode('?', $url, 2);
/*

View File

@ -170,7 +170,7 @@ if (isset($_POST['createview']) || isset($_POST['alterview'])) {
exit;
}
$sql_query = ! empty($_GET['sql_query']) ? $_GET['sql_query'] : '';
$sql_query = ! empty($_POST['sql_query']) ? $_POST['sql_query'] : '';
// prefill values if not already filled from former submission
$view = array(
@ -185,8 +185,8 @@ $view = array(
'with' => '',
);
if (Core::isValid($_GET['view'], 'array')) {
$view = array_merge($view, $_GET['view']);
if (Core::isValid($_POST['view'], 'array')) {
$view = array_merge($view, $_POST['view']);
}
$url_params['db'] = $GLOBALS['db'];