Enrolment plugin name can't have numbers in it?

Enrolment plugin name can't have numbers in it?

by Paul Vaughan -
Number of replies: 4
Hi all, just a quick query.

I work for a FE college and I've been rewriting our enrolment plugin. To ensure we have a fallback in case things go horribly wrong in September I duplicated our current enrolment plugin folder, changed every instance of the enrolment plugin name to 'pluginname09' (folder, code, everything!) to indicate the year we changed the plugin, but it continues to use the old plugin's config settings.

After a bit of investigation I find that in admin/enrol_config.php the enrolment plugin's name should only be 'English letters':

10: $enrol = required_param('enrol', PARAM_ALPHA);

...so it is using the old plugin's settings (but quietly).

Is there any major reason for this? Adding '09' to the end of my edited plugin's name is certainly easier than renaming the whole thing (especially as the changes are minor) but looks like I'll have to or bad things will happen!

P.
Average of ratings: -
In reply to Paul Vaughan

Re: Enrolment plugin name can't have numbers in it?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Actually no plugins can have digits in their names. I've been tripped up by this myself (qti2 in my case). I have no idea if this was a conscious decision or just a 'feature'.
In reply to Howard Miller

Re: Enrolment plugin name can't have numbers in it?

by Paul Vaughan -
Well you live and learn!

I have changed the plugin's name to the name of a character from a book I was recently reading, so the plugin is now called 'alkad'. I may follow Ubuntu's lead: the next one can be called 'barney'. Suggestions happily taken for the remainder of the alphabet! ;)

P.
In reply to Paul Vaughan

Re: Enrolment plugin name can't have numbers in it?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Do I spot another Peter F Hamilton fan?

(Apologies for the off-topic post.)

Plugin names as PARAM_ALPHA is perhaps excessively cautious. On the other hand it is not difficult to work within that, so there is no harm in being so restrictive.
In reply to Tim Hunt

Re: Enrolment plugin name can't have numbers in it?

by Paul Vaughan -
Now I know the restrtiction/limitation is there, I'm more than happy to work with it.

It was initially strange that my new plugin was doing exactly what the old plugin was, simply because I had named the new plugin the same as the old plugin but with '09' on the end (which then got stripped off, which caused the original plugin to be used).

Cheers.

(PFH: indeed! I just read the Night's Dawn trilogy in it's entirety back-to-back... again! Wow. Can't wait for Void Trilogy book 3, as I have books 1 and 2 and haven't read them yet. Oops, back to work...)