-
Bug
-
Resolution: Fixed
-
Minor
-
2.7.3, 2.8
-
None
-
2.8, 2.7.3
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_28_STABLE
Because of the way that the capabilities array is constructed, it breaks the usage of the Edit roles by capability plugin: https://moodle.org/plugins/view.php?plugin=tool_editrolesbycap
Stack trace:
Fatal error: Cannot redeclare mod_dataform_capabilities_dataform() (previously declared in /usr/local/moodle/releases/2.x/mod/dataform/db/access.php:42) in /usr/local/moodle/releases/2.x/mod/dataform/db/access.php on line 42
Call Stack
|
# Function Location
|
1 {main}( ) ../index.php:0
|
2 tool_editrolesbycap_load_role_definitions( ) ../index.php:67
|
3 tool_editrolesbycap_get_default_permission( ) ../locallib.php:103
|
4 get_default_capabilities( ) ../locallib.php:67
|
5 load_capability_def( ) ../accesslib.php:2601
|
The problem is when accesslib.php: load_capability_def( ) is called it calls require on the db/access.php file. Since this is called multiple times per role we get a "Cannot redeclare" error.
A possible fix could be to not make the access.php file use functions, but just have re-defined arrays. Or move the functions to another include file that is included only once.