Question: Why no numbers in module name?

Question: Why no numbers in module name?

by Herson Cruz -
Number of replies: 3
Hello,
I'm developing a new module for H5P platform and wanted to call it mod_h5p, can someone please explain why there are no numbers allowed in module names?

Already did some tests, and it seems that for adding or editing an instance of the module, the only modifications needed for it to work are located on course/mod.php and course/modedit.php, changing:

$add = optional_param('add', '', PARAM_ALPHA);

for

$add = optional_param('add', '', PARAM_RAW);

But not sure of other implications this change may have or if will affect further functionality like cron or course completion process.

Thanks,
Average of ratings: -
In reply to Herson Cruz

Re: Question: Why no numbers in module name?

by Darko Miletić -

That is one of the core systems decisions that you should not change. In general changing core is bad idea.


mod_hfivep is also acceptable

In reply to Herson Cruz

Re: Question: Why no numbers in module name?

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Best to stick to the naming convention. You can have it display everywhere in the system as "HP5" if you wish by using the language strings.

mike

In reply to Herson Cruz

Re: Question: Why no numbers in module name?

by Paul Nicholls -

Further to the points made by Darko and Mike, don't even think about using PARAM_RAW there!  That would disable the cleaning entirely, potentially creating a security vulnerability.  If you really wanted to make this change (but please don't - it wouldn't be integrated into core, so your plugin would only ever be compatible with sites which implemented your hack), a better option would be PARAM_ALPHANUM, which would still perform the usual cleaning but allow numbers in addition to letters.

That said, I was contemplating building some kind of H5P plugin myself - are you building a simple resource module to allow use of H5P content, or are you intending to get fancy with it?  I'd be keen to hear more about your intentions and progress, and hope you'll be making your plugin available to the community; if you get your code up on Github and share it here in the forums, there's also a distinctly non-zero chance that other developers will be willing to lend a hand... (I can't make any promises, but I might be able to help out at some stage)

Average of ratings:Useful (1)