Invalid subtype directory 'mod/lti/source' detected

Invalid subtype directory 'mod/lti/source' detected

Mike Henry發表於
Number of replies: 4
Web server logs across multiple Moodle versions show "invalid subtype directory 'mod/lti/source' detected" in 'D:\inetpub\wwwroot\moodle/mod/lti'." Our installation does have the moodle/mod/lti/source directory but has no files or sub-directories, as we remove the shipped readme.txt and upgrade.txt files for security purposes. Is this the cause of the warning?
評比平均分數: -
In reply to Mike Henry

Re: Invalid subtype directory 'mod/lti/source' detected

Paul Holden發表於
Core developers的相片 Moodle HQ的相片 Moodle Workplace team的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
Yes, deleting expected directories is going to cause you problems (as you've found, and reported in MDL-79175)

If this is really for "security purposes" you'd be better looking at the following security recommendations and denying access via your webserver config, rather than deleting stuff: https://docs.moodle.org/402/en/Apache#Hiding_internal_paths
In reply to Paul Holden

Re: Invalid subtype directory 'mod/lti/source' detected

Mike Henry發表於
Noted. But the directory does exist, it just does not include the readme.txt and upgrade.txt files included in the Moodle distro.
In reply to Mike Henry

Re: Invalid subtype directory 'mod/lti/source' detected

Jake Dallimore發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
Hi Mike,

The removal of those 2 files inside the mod/lti/source directory, while not recommended, will not cause the error you're seeing there. That failure is caused by the following is_dir() check: https://github.com/moodle/moodle/blob/99a7a7c782f01f7d8e3776d8880804bf12d76899/lib/classes/component.php#L608-L611

I'd probably be looking at the permissions in that directory, or exploring why that call is failing, resulting in the error logging. The mod/lti/service directory is another subplugin directory within LTI and you aren't getting errors for that one, so might be a good comparison point. Noting that I'm on linux and that there may be a subtly different behaviour for is_dir() on windows. Not saying there definitely is, but it's perhaps something worth checking too.

Cheers,