MDL-78807 reportbuilder: ensure report base conditions are non-empty.
This commit is contained in:
@@ -225,16 +225,20 @@ abstract class base {
|
||||
}
|
||||
|
||||
/**
|
||||
* Define more complex clause that will always be applied to the report query
|
||||
* Define more complex/non-empty clause to apply to the report query
|
||||
*
|
||||
* @param string $where
|
||||
* @param array $params Note that the param names should be generated by {@see database::generate_param_name}
|
||||
*/
|
||||
final public function add_base_condition_sql(string $where, array $params = []): void {
|
||||
|
||||
// Validate parameters always, so that potential errors are caught early.
|
||||
database::validate_params($params);
|
||||
|
||||
$this->sqlwheres[] = trim($where);
|
||||
$this->sqlparams = $params + $this->sqlparams;
|
||||
if ($where !== '') {
|
||||
$this->sqlwheres[] = trim($where);
|
||||
$this->sqlparams = $params + $this->sqlparams;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user