lmscloud-io/mdlcode-docs

Feature request: Totara support

Closed this issue · 4 comments

There's a fork of Moodle called Totara, which relocates most of the Moodle code from the Git repo's top level, into a ./server subdirectory. (See: https://totara.atlassian.net/wiki/spaces/DEV/pages/121188190/Totara+13+code+reorganisation ). But it leaves the main config.php file in the Git repo top level.

Consequently, this plugin complains every time I open up a Totara repo. I can mostly work around that by opening up the ./server directory instead, but then I can't see the config.php or things in those other directories.

It'd be nice if the plugin could detect that I'm editing a Totara instance, or if there was an optional preference to specify which directory to look in for the main Moodle code.

Hi Aaron,

That's cool that totara did it, Moodle needs to reorganise folders as well.

I wonder how well MDLCode works with totara code. Afaik they changed much more than just folder structure.

I can definitely add logic to detect totara root. What files should I look for to know that it is totara? If you don't want to put it in the issue, you can email at info@lmscloud.io

Lol, quicker response than I expected! :-)

I wonder how well MDLCode works with totara code. Afaik they changed much more than just folder structure.

That's true. MDLCode actually has problems with Totara even with my workaround. It (correctly) detects it as being based on Moodle 3.4, and shows a message saying it'll treat it as Moodle 3.11. But the "Create new plugin" wizard doesn't work; the "Plugin type" menu is empty.

What files should I look for to know that it is totara?

At my workplace, we have some scripts that detect a Totara site by looking for the presence of the ./server directory. If you want to be more specific, you could check for a directory called ./server/totara or check to see if ./server/version.php contains the string $TOTARA.

Hi @agwells ,
MDLCode version 1.0.22 was just released. It contains the following changes:

  • Allow to work with Moodle instance when it is not in a workspace root folder
  • Detect plugins and subplugins from PHP files rather than from JSON (used in Moodle before 3.8)

It does not specifically target totara nor adds any functionality for totara, you will still get the warning about 'version 3.4 not fully supported'.

These "rules" are built from the directives in this branch
moodle/moodle@MOODLE_39_STABLE...lmscloud-io:moodle:mdlcode39

They indicate, for example, that some functions expect arguments that are names of strings or capabilities or webservices, etc, so MDLCode highlights this argument as a reference to the said string/capability/webservice.

It may not always backport well to Moodle 3.4 and definitely will not cover any of the additional code in totara. I do not want to commit to supporting totara as thorough as moodle, especially since I do not know totara code at all.

However if you can point out to some easy wins that we can add to MDLCode to detect something totara-specific, let me know.

Hi @lmscloud-io,

Sorry for taking so long to get back to you. I've upgraded to version 1.0.32, and I can confirm that it is now working with a Totara 17 codebase. Thanks!

I do not want to commit to supporting totara as thorough as moodle, especially since I do not know totara code at all.

That's 100% understandable, since Totara keeps their code behind a subscription & licensing wall. I wouldn't expect any plugin developer to support Totara in depth unless they had come to some sort of agreement with Totara Learning Solutions.

However if you can point out to some easy wins that we can add to MDLCode to detect something totara-specific, let me know.

It actually looks like the extension is already fully supporting Totara's shared functionality with Moodle now. So there probably aren't any more easy wins to be had, but I'll keep an eye out.