Skip to content
Permalink
Browse files

fixed trigger for updating cache maintenance flags;

removed redundant log_type information
  • Loading branch information...
following5 committed Mar 1, 2016
1 parent 072d178 commit d8122186a3758a2b04c67b6aae28bb2bbc3625fb
Showing with 12 additions and 2 deletions.
  1. +5 −1 htdocs/doc/sql/stored-proc/maintain-current.inc.php
  2. +7 −1 htdocs/lib2/logic/cachelog.class.php
@@ -758,7 +758,11 @@
BEGIN
SET @dont_update_listingdate=1;
IF NEW.`status` IN (4,5,6,7) THEN
/* The first IF condition is necessary so that the NM/LO flags
* can be updated by a log which also changes the cache state,
* independently of the order of log-insertion and cache-state-update.
*/
IF NEW.`status` != OLD.`status` AND NEW.`status` IN (4,5,6,7) THEN
SET NEW.`needs_maintenance`=0;
SET NEW.`listing_outdated`=0;
END IF;
@@ -245,11 +245,17 @@ function getAnyChanged()
// return if successfull (with insert)
function save()
{
if (in_array($this->getType(), array(cachelog::LOGTYPE_ARCHIVED, cachelog::LOGTYPE_LOCKED, cachelog::LOGTYPE_LOCKED_INVISIBLE)))
// additional safeguard against setting unallowd log flags
if (!sql_value("
SELECT `maintenance_logs`
FROM `log_types`
WHERE `id`='&1'",
false, $this->getType()))
{
$this->setNeedsMaintenance(false);
$this->setListingOutdated(false);
}
sql_slave_exclude();
$saved = $this->reCacheLog->save();
if ($saved && $this->nLogId == ID_NEW)

0 comments on commit d812218

Please sign in to comment.
You can’t perform that action at this time.