Warning: opendir .git/logs

Warning: opendir .git/logs

by Joël Schmid -
Number of replies: 3

Hey guys

If I open up the plugin overview I get the following warnings displayed (debugging needs to be enabled). The warnings appears, because the plugin_manager.php is not able to read the .git/logs folder, which he actually doesn't need to. Those warning obviously appear for each plugin which I installed using git. 

Warning: opendir(/var/www/moodle/mod/choicegroup/.git/logs): failed to open dir: Permission denied in /var/www/html/moodle-dev/lib/classes/plugin_manager.php on line 2193

Warning: readdir() expects parameter 1 to be resource, boolean given in /var/www/moodle/mod/lib/classes/plugin_manager.php on line 2200

Does anyone get the same warnings? I didn't find a forum post about it? Should this be reported as a bug so maybe the plugin_manager.php would ignore all hidden folders, such as the .git folder?

Thank you in advance for your feedback!

Average of ratings: -
In reply to Joël Schmid

Re: Warning: opendir .git/logs

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

No, not a bug. I would say...

- you wouldn't normally have a .git file in a module like that 

- if you *do* then you look like a developer and you probably shouldn't be trying to install plugins through the UI. 

The response is actually true if you think about it. It can't replace the plugin with a new version because the directory isn't writeable. It can't delete it and add the new version because of the .git folder which isn't writeable. 

In reply to Howard Miller

Re: Warning: opendir .git/logs

by Joël Schmid -

Hey Howard 

Thanks for your help!

- you wouldn't normally have a .git file in a module like that 

--> We had to install some plugins which are not available it the official Moodle Plugin directory, so I decided to install all additional plugins with git so everything is consistent. Due to this I have a .git folder for each additional plugin.

The response is actually true if you think about it. It can't replace the plugin with a new version because the directory isn't writeable. It can't delete it and add the new version because of the .git folder which isn't writeable. 

-->True, but it depends, if I try to upgrade a plugin and the warning message would appear, that would be ok, but I only want to display the plugin overview. Furthermore I thought installing and updating plugins with git is a common way to do it?
In reply to Joël Schmid

Re: Warning: opendir .git/logs

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You can upgrade plugins using git OR you can upgrade plugins using the built in plugins manager. You can't do both. 

You obviously have debugging turned up and while it would be easy to say "turn off debugging and the messages will go away" I would prefer to suggest that there is a minor bug here in that it shouldn't generate a warning because the directory is not writeable. It should just warn you that you cannot upgrade through the UI.