mirror of
https://github.com/moodle/moodle.git
synced 2025-02-24 03:53:49 +01:00
MDL-83182 core_files: Add a reference to the create_file_from_string()
This commit is contained in:
parent
09e56f2d1a
commit
2f1e4e4f29
@ -230,6 +230,8 @@ class exifremover_service extends service {
|
|||||||
'itemid' => $this->storedfile->get_itemid(),
|
'itemid' => $this->storedfile->get_itemid(),
|
||||||
'filepath' => $this->storedfile->get_filepath(),
|
'filepath' => $this->storedfile->get_filepath(),
|
||||||
'filename' => $this->storedfile->get_filename(),
|
'filename' => $this->storedfile->get_filename(),
|
||||||
|
'repositoryid' => $this->storedfile->get_repository_id(),
|
||||||
|
'reference' => $this->storedfile->get_reference(),
|
||||||
];
|
];
|
||||||
$fs = get_file_storage();
|
$fs = get_file_storage();
|
||||||
$existingfile = $fs->get_file(
|
$existingfile = $fs->get_file(
|
||||||
|
@ -1493,6 +1493,10 @@ class file_storage {
|
|||||||
|
|
||||||
$newrecord->pathnamehash = $this->get_pathname_hash($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->filename);
|
$newrecord->pathnamehash = $this->get_pathname_hash($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->filename);
|
||||||
|
|
||||||
|
if (!empty($filerecord->repositoryid)) {
|
||||||
|
$newrecord->referencefileid = $this->get_or_create_referencefileid($filerecord->repositoryid, $filerecord->reference);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->create_file($newrecord, $notify);
|
$this->create_file($newrecord, $notify);
|
||||||
} catch (dml_exception $e) {
|
} catch (dml_exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user