New Custom Activity Issue - Cant find record in table modules

New Custom Activity Issue - Cant find record in table modules

by Frank Troglauer -
Number of replies: 3

Good afternoon,

I have been working on a new activity type and have run into an issue. When I go to add a new activity of that type it goes to a page with this error. 

_____________________________________________________________________________________________________

Can not find data record in database table modules.

More information about this error

Debug info: SELECT * FROM {modules} WHERE name = ?
[array (
0 => 'customActivity',
)] 
Error code: invalidrecord
Stack trace:
  • line 1455 of \lib\dml\moodle_database.php: dml_missing_record_exception thrown
  • line 1431 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
  • line 400 of \course\modlib.php: call to moodle_database->get_record()
  • line 63 of \course\modedit.php: call to can_add_moduleinfo()

_____________________________________________________________________________________________________

The entry actually exists, but you will notice it is customActivity2 because that is what i have been setting it up as. It is almost like it doesn't like the #2 in the code and rejects it. Or I might have missed setting it up somewhere it needs to be. See picture for entry in database. 

So my question is where in the custom module code is the setting for this so I can make sure it is set appropriately? It can't be in \course\modedit.php, modlib.php, moodle_database.php and moodle_database.php as those are outside of my custom module code. 

Any help or advice would be very appreciative! 

Attachment Screenshot_5.png
Average of ratings: -
In reply to Frank Troglauer

Re: New Custom Activity Issue - Cant find record in table modules

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle activity names must be lower-case letters, with no symbols or numbers (technically they can include '_' characters, but that is discouraged). Trying to do anything else will encounter problems.

Average of ratings: Useful (1)
In reply to Davo Smith

Re: New Custom Activity Issue - Cant find record in table modules

by Frank Troglauer -

My apologies, it actually is lowercase. 


Attachment Screenshot_6.png
In reply to Frank Troglauer

Re: New Custom Activity Issue - Cant find record in table modules

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You cannot use digits.