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

Fix/4636 #4637

Merged
merged 2 commits into from Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions inc/rule.class.php
Expand Up @@ -2698,7 +2698,7 @@ function getRulesForCriteria($crit) {
/// TODO : not working for SLALevels : no sub_type

//Get all the rules whose sub_type is $sub_type and entity is $ID
$crit = [
$query = [
'SELECT' => $this->getTable() . '.id',
'FROM' => [
getTableForItemType($this->ruleactionclass),
Expand All @@ -2712,10 +2712,10 @@ function getRulesForCriteria($crit) {
];

foreach ($crit as $field => $value) {
$crit['WHERE'][getTableForItemType($this->ruleactionclass).'.'.$field] = $value;
$query['WHERE'][getTableForItemType($this->ruleactionclass).'.'.$field] = $value;
}

$iterator = $DB->request($crit);
$iterator = $DB->request($query);

while ($rule = $iterator->next()) {
$affect_rule = new Rule();
Expand Down
2 changes: 1 addition & 1 deletion inc/ruleimportentity.class.php
Expand Up @@ -141,7 +141,7 @@ function displayAdditionalRuleCondition($condition, $criteria, $name, $value, $t
function getAdditionalCriteriaDisplayPattern($ID, $condition, $pattern) {

$crit = $this->getCriteria($ID);
if ($crit['field'] == '_source') {
if (count($crit) && $crit['field'] == '_source') {
$name = Plugin::getInfo($pattern, 'name');
if (empty($name)) {
return false;
Expand Down