Skip to content

Commit

Permalink
Extract three letter language code for IA upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
hornc authored and notartom committed Apr 19, 2023
1 parent edba95d commit 641d929
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/controllers/private/Iarchive_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function upload()

$description = $this->_get_full_description($params, $project);
$params['description'] = trim(preg_replace('/\s+/', ' ', $description)); //trims all newlines before placing in header
$params['language'] = $this->data['language'];
$params['language'] = $this->data['language_code'];

// Close db connection before uploading to avoid hogging connections
$this->db->close();
Expand Down Expand Up @@ -109,6 +109,7 @@ function _get_full_description($params, $project)
$language = $this->language_model->get($project->language_id);

$this->data['language'] = empty($language) ? 'English' : $language->language;
$this->data['language_code'] = empty($language) ? 'eng' : $language->three_letter_code;

$this->load->model('project_model');
$this->data['readers'] = $this->project_model->create_project_reader_list($project->id);
Expand Down

0 comments on commit 641d929

Please sign in to comment.