Validations for default values

Former-commit-id: a33139b817ece206a611d5f2678b62c876a8e41f
This commit is contained in:
marcos.alconada 2019-02-22 11:21:38 +01:00
parent 6ef1c3951a
commit 35ad2f4bb5
1 changed files with 12 additions and 1 deletions

View File

@ -63,6 +63,17 @@ $sort = get_parameter('sort', 'none');
$id_module = (int) get_parameter('id_module', 0); $id_module = (int) get_parameter('id_module', 0);
$ag_custom_fields = (array) get_parameter('ag_custom_fields', []); $ag_custom_fields = (array) get_parameter('ag_custom_fields', []);
$module_option = (int) get_parameter('module_option', 1); $module_option = (int) get_parameter('module_option', 1);
$autosearch = false;
// It is validated if it receives parameters different from those it has by default
if ($ag_freestring != '' || $moduletype != '' || $datatype != ''
|| $ag_modulename != '' || $refr != 0 || $offset != 0 || $status != 4
|| $modulegroup != -1 || $tag_filter != 0 || $sortField != ''
|| $sort != '' || $id_module != 0 || $ag_custom_fields != null
|| $module_option != 1
) {
$autosearch = true;
}
if (!is_metaconsole()) { if (!is_metaconsole()) {
$ag_group = (int) get_parameter('ag_group', 0); $ag_group = (int) get_parameter('ag_group', 0);
@ -947,7 +958,7 @@ $sql = 'SELECT
// When you enter for the first time you have less than 4 query params in the url // When you enter for the first time you have less than 4 query params in the url
$first_interaction = count($_GET); $first_interaction = count($_GET);
// We do not show the modules until the user searches with the filter // We do not show the modules until the user searches with the filter
if ($first_interaction) { if ($first_interaction || $autosearch) {
if (! defined('METACONSOLE')) { if (! defined('METACONSOLE')) {
$result = db_get_all_rows_sql($sql); $result = db_get_all_rows_sql($sql);