mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-44501 mod_data: Only attempt to export files when a file exists.
The error only occurs when portfolios are enabled and there is only one field which is a file field.
This commit is contained in:
parent
8e478c99d3
commit
f3998ce41e
@ -348,7 +348,9 @@ class data_portfolio_caller extends portfolio_module_caller_base {
|
||||
$includedfiles = array();
|
||||
foreach ($fields as $singlefield) {
|
||||
if (is_callable(array($singlefield, 'get_file'))) {
|
||||
$includedfiles[] = $singlefield->get_file($record->id);
|
||||
if ($file = $singlefield->get_file($record->id)) {
|
||||
$includedfiles[] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($includedfiles) == 1 && count($fields) == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user