QuickForm Error: nonexistent html element Element '' does not exist in HTML_QuickForm::getElement()

Re: QuickForm Error: nonexistent html element Element 'uploaded' does not exist in HTML_QuickForm::getElement()

by Manuel Antonio Rivera Socarrás -
Number of replies: 0
The required rule that I put, I put it because I was fixing in some moodle modules like scrom, lesson and in some of them I learned that and that's why I put it, but it was to prove, and that is not what is affecting the operation Of the plugin, the error is throwing it in the second line, since when I debug to know well what is happening, when I create $ realfilename it returns a value false because the name is not getting it, and when it gets to create the directory $ Importfile, you can not create it because realfilename is false.


$realfilename = $mform->get_new_filename('uploaded');        
$importfile = "{$CFG->tempdir}/questionimport/{$realfilename}";
make_temp_directory('questionimport');
if (!$result = $mform->save_file('uploaded', $importfile, true)) {
throw new moodle_exception('uploadproblem');
}
Thank you Friend, for replying