Skip to content

Commit

Permalink
Initialize $request in submit_translations(). Fixes ticket #1239.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Jul 22, 2010
1 parent 663f079 commit 108fff7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/gallery/helpers/l10n_client.php
Expand Up @@ -194,12 +194,15 @@ static function submit_translations() {

// @todo Batch requests (max request size)
// @todo include base_revision in submission / how to handle resubmissions / edit fights?
$request = new stdClass();
foreach (db::build()
->select("key", "message", "locale", "base_revision", "translation")
->from("outgoing_translations")
->execute() as $row) {
$key = $row->key;
if (!isset($request->{$key})) {
$request->{$key} = new stdClass();
$request->{$key}->translations = new stdClass();
$request->{$key}->message = json_encode(unserialize($row->message));
}
$request->{$key}->translations->{$row->locale} = json_encode(unserialize($row->translation));
Expand Down

0 comments on commit 108fff7

Please sign in to comment.