Using 2.1+ I'm just trying to duplicate the upload repository plugin, and make a second upload repository plugin. Seems easy enough, I renamed the folder, the class and language files, etc. I then go and enable the plugin in the manage repository page. All good so far. However, when I then go and test the plugin, I get a lots of errors and it does not appear in the list of available plugins.
The errors look like this:
Capability "repository/uploadsound:view" was not found! This should be fixed in code.
- line 579 of /lib/accesslib.php: call to debugging()
- line 866 of /repository/lib.php: call to has_capability()
- line 2107 of /repository/lib.php: call to repository::get_instances()
- line 189 of /lib/form/editor.php: call to initialise_filepicker()
- line 183 of /lib/pear/HTML/QuickForm/Renderer/Tableless.php: call to MoodleQuickForm_editor->toHtml()
- line 2280 of /lib/formslib.php: call to HTML_QuickForm_Renderer_Tableless->renderElement()
- line 403 of /lib/pear/HTML/QuickForm/element.php: call to MoodleQuickForm_Renderer->renderElement()
- line 1627 of /lib/pear/HTML/QuickForm.php: call to HTML_QuickForm_element->accept()
- line 1333 of /lib/formslib.php: call to HTML_QuickForm->accept()
- line 1670 of /lib/pear/HTML/QuickForm.php: call to MoodleQuickForm->accept()
- line 424 of /lib/pear/HTML/Common.php: call to HTML_QuickForm->toHtml()
- line 204 of /lib/pear/HTML/QuickForm/DHTMLRulesTableless.php: call to HTML_Common->display()
- line 824 of /lib/formslib.php: call to HTML_QuickForm_DHTMLRulesTableless->display()
- line 861 of /mod/forum/post.php: call to moodleform->display()
Figured it out, I was not letting the new repos install before trying to use them. Once they installed, the errors went away and they worked.
Does anyone have a quick example of how to add a custom form to repo's filepicker? I can see how to duplicate existing elements, but I'm not sure how to create a completely new form...