Skip to content

Commit

Permalink
small fix to get field ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
georgmaisser committed Oct 13, 2023
1 parent f3faac4 commit 9681816
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rule/ftpsyncfiles/rule_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,20 @@ public function trigger(\core\event\base $event) {
$data = new stdClass();
$data->eids = [];

$fieldid = datalynxfield_entryauthor::_USERID;
$filename = $file->get_filename();

$entryid = -1;
$data->eids[$entryid] = $entryid;
// TODO: If filename is not userid get userid here.
$fieldid = datalynxfield_entryauthor::_USERID;
$data->{"field_{$fieldid}_{$entryid}"} = $this->authorid;

$fields = $this->dl->get_fields();

$field = reset($this->dl->get_fields_by_type('file'));
$fieldid = $field->field->id;
$data->{"field_{$fieldid}_{$entryid}_filemanager"} = $this->draftitemid;
$data->{"field_{$fieldid}_{$entryid}_content"} = 1;
// $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);
Expand Down

0 comments on commit 9681816

Please sign in to comment.