Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/install/upgrades.php
Show First 20 Lines • Show All 632 Lines • ▼ Show 20 Line(s) | |||||
$sql = 'SELECT LanguageId, Phrase, MIN(LastChanged) AS LastChanged, COUNT(*) AS DupeCount | $sql = 'SELECT LanguageId, Phrase, MIN(LastChanged) AS LastChanged, COUNT(*) AS DupeCount | ||||
FROM ' . $table_name . ' | FROM ' . $table_name . ' | ||||
GROUP BY LanguageId, Phrase | GROUP BY LanguageId, Phrase | ||||
HAVING COUNT(*) > 1'; | HAVING COUNT(*) > 1'; | ||||
$duplicate_phrases = $this->Conn->Query($sql); | $duplicate_phrases = $this->Conn->Query($sql); | ||||
foreach ($duplicate_phrases as $phrase_record) { | foreach ($duplicate_phrases as $phrase_record) { | ||||
// 1. keep phrase, that was added first, because it is selected in PhrasesCache::LoadPhraseByLabel | // 1. keep phrase, that was added first, because it is selected in kPhraseCache::LoadPhraseByLabel. | ||||
$where_clause = Array ( | $where_clause = Array ( | ||||
'LanguageId = ' . $phrase_record['LanguageId'], | 'LanguageId = ' . $phrase_record['LanguageId'], | ||||
'Phrase = ' . $this->Conn->qstr($phrase_record['Phrase']), | 'Phrase = ' . $this->Conn->qstr($phrase_record['Phrase']), | ||||
'LastChanged' . ' = ' . $phrase_record['LastChanged'], | 'LastChanged' . ' = ' . $phrase_record['LastChanged'], | ||||
); | ); | ||||
$sql = 'SELECT ' . $id_field . ' | $sql = 'SELECT ' . $id_field . ' | ||||
FROM ' . $table_name . ' | FROM ' . $table_name . ' | ||||
▲ Show 20 Lines • Show All 1843 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
// use object to reset domain cache as well | // use object to reset domain cache as well | ||||
$object->LoadFromHash($site_domain); | $object->LoadFromHash($site_domain); | ||||
$object->SetDBField('SSLDomainName', parse_url($site_domain['SSLDomainName'], PHP_URL_HOST)); | $object->SetDBField('SSLDomainName', parse_url($site_domain['SSLDomainName'], PHP_URL_HOST)); | ||||
$object->Update(); | $object->Update(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
No newline at end of file |