Index: trunk/kernel/include/language.php =================================================================== diff -u -r271 -r283 --- trunk/kernel/include/language.php (.../language.php) (revision 271) +++ trunk/kernel/include/language.php (.../language.php) (revision 283) @@ -120,22 +120,6 @@ $edit_table = $objSession->GetEditTable($this->SourceTable); - $sql = "SELECT l.PhraseId AS pid FROM ".GetTablePrefix()."Phrase AS l LEFT JOIN $edit_table AS e ON e.PhraseId = l.PhraseId WHERE e.PhraseId IS NULL ORDER BY l.PhraseId"; - $rs = $this->adodbConnection->Execute($sql); - - $ids = ''; - while ($rs && !$rs->EOF) { - $ids .= $rs->fields['pid'].','; - $rs->MoveNext(); - } - - $ids = substr($ids, 0, strlen($ids) - 1); - - if (strlen($ids) > 0) { - $sql = "DELETE FROM ".GetTablePrefix()."Phrase WHERE PhraseId IN (".$ids.")"; - $this->adodbConnection->Execute($sql); - } - //$idlist = array(); $sql = "SELECT * FROM $edit_table"; @@ -145,7 +129,7 @@ { $data = $rs->fields; $c = $this->AddItemFromArray($data); - $c->Dirty(); + $c->Dirty(); if($data["PhraseId"]>0) { $c->Update(); @@ -158,8 +142,13 @@ } $rs->MoveNext(); - } + } + // Phrases deleted from temporary table are marked with LanguageId = 0, when saving we need to actually delete them all + // The idea was taken from Images edit by Kostja + $sql = "DELETE FROM ".$this->SourceTable." WHERE LanguageId = 0"; + $this->adodbConnection->Execute($sql); + if((int)$_GLOBALS["debuglevel"]) echo $sql."
\n"; $this->adodbConnection->Execute($sql);