From 9f0324d2d565f8b24317dc5b979cb59c238d6e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Mai=C3=9Fer?= Date: Fri, 13 Oct 2023 19:30:47 +0200 Subject: [PATCH] small fix --- rule/ftpsyncfiles/rule_class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rule/ftpsyncfiles/rule_class.php b/rule/ftpsyncfiles/rule_class.php index 39d4b602..77daa58d 100644 --- a/rule/ftpsyncfiles/rule_class.php +++ b/rule/ftpsyncfiles/rule_class.php @@ -97,6 +97,7 @@ public function __construct($df = 0, $rule = 0) { public function trigger(\core\event\base $event) { global $CFG, $DB, $USER; require_once("$CFG->dirroot/mod/datalynx/classes/datalynx.php"); + require_once("$CFG->dirroot/mod/datalynx/field/entryauthor/fieldclass/datalynx_entryauthor.php"); require_once("$CFG->dirroot/mod/datalynx/entries_class.php"); require_once("$CFG->dirroot/mod/datalynx/view/csv/view_class.php"); require_once($CFG->libdir.'/filelib.php'); @@ -123,17 +124,15 @@ public function trigger(\core\event\base $event) { $data = new stdClass(); $data->eids = []; - $fields = $this->dl->get_fields(); - $fieldid = datalynxfield_entryauthor::_USERID; $filename = $file->get_filename(); $entryid = -1; $data->eids[$entryid] = $entryid; // TODO: If filename is not userid get userid here. - // Entry author is specified in the rule settings: $data->{"field_{$fieldid}_{$entryid}"} = $this->authorid; $data->{"field_{$fieldid}_{$entryid}_filemanager"} = $this->draftitemid; + $data->{"field_{$fieldid}_{$entryid}_content"} = 1; $dlentries = new datalynx_entries($this->dl); // Set teammember from filename. $data->{"field_{$this->teammemberfieldid}_{$entryid}"} = $this->get_userid_from_filename($filename);