Fix author id

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 20f1e3b11f
commit a528c98074
  1. 7
      main/cron/import_csv.php
  2. 7
      main/inc/lib/AnnouncementManager.php

@ -1053,7 +1053,12 @@ class ImportCsv
$event['session_id'],
$subject,
$emailBody,
['everyone']
['everyone'],
[],
null,
null,
false,
$this->defaultAdminId
);
if ($announcementId) {

@ -413,6 +413,8 @@ class AnnouncementManager
* @param string $file_comment Comment describing the attachment
* @param string $end_date
* @param bool $sendToUsersInSession
* @param int $authorId
*
* @return int false on failure, ID of the announcement on success
*/
public static function add_announcement(
@ -424,7 +426,8 @@ class AnnouncementManager
$file = array(),
$file_comment = null,
$end_date = null,
$sendToUsersInSession = false
$sendToUsersInSession = false,
$authorId = 0
) {
if (empty($courseInfo)) {
return false;
@ -433,7 +436,7 @@ class AnnouncementManager
$course_id = $courseInfo['real_id'];
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
$authorId = api_get_user_id();
$authorId = empty($authorId) ? api_get_user_id() : $authorId;
if (empty($end_date)) {
$end_date = api_get_utc_datetime();

Loading…
Cancel
Save