Document: Build $base_work_dir by default in DocumentManager::delete_document() and update method description - loosely refs BT#19219

pull/4453/head
Yannick Warnier 3 years ago
parent c69c790263
commit 631ab0248d
  1. 9
      main/inc/lib/document.lib.php

@ -1127,7 +1127,7 @@ class DocumentManager
*
* @param array $_course
* @param string $path Path stored in the database
* @param string $base_work_dir Path to the documents folder (if not defined, $documentId must be used)
* @param string $base_work_dir Path to the "/document" folder of this course. Will be built if not provided.
* @param int $sessionId The ID of the session, if any
* @param int $documentId The document id, if available
* @param int $groupId iid
@ -1165,7 +1165,12 @@ class DocumentManager
}
if (empty($base_work_dir)) {
return false;
if (empty($_course['directory'])) {
return false;
}
$courseDir = $_course['directory'].'/document';
$sysCoursePath = api_get_path(SYS_COURSE_PATH);
$base_work_dir = $sysCoursePath.$courseDir;
}
if (empty($documentId)) {

Loading…
Cancel
Save