i need to add new file field to upload image using filepicker function.
i added the field using below code in editcategory_form.php file.
$mform->addElement('filepicker', 'catimagefile', get_string('categoryimage'), null,$imageoptions);
But, i can't able to add and update this field into `mdl_files` table.
i follow the method for upload badges image, but still there is some issue.
can you help me with the code solution for above issue?
Yes, i already check for this link,
But i need save the file/images into mdl_files Table.
i follow the file upload code of upload badges. but it's not working.
can you please help me in coding flow with course category coding files to add/edit files field.
Thanks for your reply!
Yes, i already enabled the developer debug mode. and it's shows the error when i update the category.
i added the code for display image upload field on
call the function in below file
and add the function in below file
see the below images of my code added into above files
Well the problem seems to be that $coursecat is not obviously not set in the else bit so you cant use these:
You probably need to put those two lines after this :
$category = coursecat::create($data, $mform->get_description_editor_options());and then use the $category variable and do this :
Hi Hittesh Ahuja,
I follow your instruction and add the code in else part after create category.
But still having same error, even i update the code error display for old function.
i already Purge all caches. Is there any thing that i need to do to remove cache ?
also what about the function to update image fields ?
where should i add code to update file field ?
see below images.
here is the core (moodle 3.2) files that i was changed.
see below zip file.
Also can you please help me how to display custom block to student and admin login.
i created on custom block to display course categories only. it's display on admin login my/ section but not display on student login.