mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
test: add ShareLinkTest + PureLogicTest (TDD), fix coverMap undefined in SearchController
This commit is contained in:
@@ -256,6 +256,8 @@ class ThesisEditController
|
||||
'synopsis' => trim($post['synopsis'] ?? ''),
|
||||
'context_note' => trim($post['context_note'] ?? ''),
|
||||
'file_size_info' => $this->buildFileSizeInfo($post),
|
||||
'duration_pages' => trim($post['duration_pages'] ?? ''),
|
||||
'duration_minutes'=> trim($post['duration_minutes'] ?? ''),
|
||||
'baiu_link' => trim($post['lien'] ?? ''),
|
||||
'license_id' => filter_var($post['license_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
|
||||
'access_type_id' => filter_var($post['access_type_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
|
||||
@@ -291,12 +293,18 @@ class ThesisEditController
|
||||
$this->db->setThesisJury($thesisId, $juryMembers);
|
||||
|
||||
// ── 4. Languages ──────────────────────────────────────────────────
|
||||
$this->db->setThesisLanguages(
|
||||
$thesisId,
|
||||
isset($post['languages']) && is_array($post['languages'])
|
||||
? $post['languages']
|
||||
: []
|
||||
);
|
||||
$langIds = isset($post['languages']) && is_array($post['languages'])
|
||||
? $post['languages']
|
||||
: [];
|
||||
$autreRaw = trim($post['language_autre'] ?? '');
|
||||
if ($autreRaw !== '') {
|
||||
foreach (array_map('trim', explode(',', $autreRaw)) as $langName) {
|
||||
if ($langName !== '') {
|
||||
$langIds[] = (string)$this->db->getOrCreateLanguage($langName);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->db->setThesisLanguages($thesisId, $langIds);
|
||||
|
||||
// ── 5. Formats ────────────────────────────────────────────────────
|
||||
$this->db->setThesisFormats(
|
||||
@@ -710,7 +718,7 @@ class ThesisEditController
|
||||
/**
|
||||
* Build file_size_info from separate duration fields.
|
||||
*/
|
||||
private function buildFileSizeInfo(array $post): string
|
||||
protected function buildFileSizeInfo(array $post): string
|
||||
{
|
||||
$pages = trim($post['duration_pages'] ?? '');
|
||||
$minutes = trim($post['duration_minutes'] ?? '');
|
||||
|
||||
Reference in New Issue
Block a user