Hello everyone, I'm having an error when trying to install a plugin that I've developed.
The plugin is located in /report/repo
Then, I have a /version.php with this line and the ones needed for the versioning:
$plugin->component = 'report_repo';
Then, in /db/access.php
defined('MOODLE_INTERNAL') || die();
$capabilities = array(
'report/repo:view' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
)
);
In /lang/en/report_repo.php
$string['pluginname'] = 'My Log';
$string['repo:view'] = 'Some error message.';
In /settings.php
defined('MOODLE_INTERNAL') || die;
// Just a link to course report.
$ADMIN->add('reports', new admin_externalpage('reportrepo', get_string('pluginname', 'report_repo'),
$CFG->wwwroot . "/report/repo/index.php", 'report/repo:view'));
// No report settings.
$settings = null;
And, in /index.php, I have a line with this code:
require_capability('report/repo:view', context_system::instance());
When I try to install the new plugin I'm getting:
Capability "report/repo:view" was not found! This has to be fixed in code.
What is wrong? Is there something misplaced or incorrect? I'm using Moodle 2.6.2 but it doesn't work in 2.7 either. I'm using SQL Server 2008 and Windows Server.
Thanks in advance