Skip to content

Commit

Permalink
Hotfix for incorrectly clearing display cache
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Jun 6, 2016
1 parent 85a6d37 commit 24d2b00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions lib/pages/display.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,9 @@ public function SetMemberOf()
trigger_error(__('Error getting Display Groups'), E_USER_ERROR);
}

// Track whether we have made a change
$changed = false;

while($row = $db->get_assoc_row($resultIn))
{
// Test whether this ID is in the array or not
Expand All @@ -978,6 +981,8 @@ public function SetMemberOf()
{
trigger_error($displayGroupObject->GetErrorMessage(), E_USER_ERROR);
}

$changed = true;
}
else
{
Expand All @@ -994,9 +999,15 @@ public function SetMemberOf()
{
trigger_error($displayGroupObject->GetErrorMessage(), E_USER_ERROR);
}

$changed = true;
}
}

if ($changed)
// Clear the cache for that displayId
PDOConnect::getPool()->getItem('display/' . $displayID)->clear();

$response->SetFormSubmitResponse(__('Group membership set'), false);
$response->Respond();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/displaygroup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function SetMembers()
}

// Clear the cache for that displayId
PDOConnect::getPool()->getItem('/display' . $displayID)->clear();
PDOConnect::getPool()->getItem('display/' . $displayID)->clear();
}
else
{
Expand All @@ -498,7 +498,7 @@ public function SetMembers()
}

// Clear the cache for that displayId
PDOConnect::getPool()->getItem('/display' . $displayID)->clear();
PDOConnect::getPool()->getItem('display/' . $displayID)->clear();
}
}

Expand Down

0 comments on commit 24d2b00

Please sign in to comment.