General developer forum

New Custom Activity Issue - Cant find record in table modules

 
Picture of Frank Troglauer
New Custom Activity Issue - Cant find record in table modules
 

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! 


 
Average of ratings: -
Davo
Re: New Custom Activity Issue - Cant find record in table modules
Core developersParticularly helpful MoodlersPlugin 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)
Picture of Frank Troglauer
Re: New Custom Activity Issue - Cant find record in table modules
 

My apologies, it actually is lowercase. 



 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: New Custom Activity Issue - Cant find record in table modules
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
You cannot use digits.
 
Average of ratings: -