You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think Moosh is a great tool and really appreciate the time and effort you put into developing and making it available to the Moodle community. Unfortunately, I have come across an issue that I am really hoping you will be able to address soon.
Issue summary
I wrote a bash script that automates the installation of Moodle 3.11.7 using the CLI. The script uses Moosh v1.7 to enable plugins and pre-set many settings before the administrator logs in for the first time. I use Moosh for many things but am having trouble getting it to enable a disabled filter.
After completing the installation of Moodle, I tried to enable the Glossary Auto-Linking filter using the following Moosh command:
moosh -n filter-set glossary 1
This results in the following error message:
Invalid filter name: 'glossary''. Possible values: displayh5p,emoticon,urltolink,mediaplugin,activitynames,mathjaxloader.
The same happens whenever I try to enable any disabled filter.
What is happening
I did a bit of investigation and discovered that the issue occurs on the following lines of Moosh’s /Moosh/Command/Moodle39/Filter/FilterSet.php file.
This line properly identifies that the Glossary Auto-Linking filter is available:
Line 40: $plugininfos = core_plugin_manager::instance()->get_plugins_of_type('filter');
However, this line seems to create an array of objects that only includes filters which are currently enabled:
This results in the following error being displayed:
Invalid filter name: 'glossary''. Possible values: displayh5p,emoticon,urltolink,mediaplugin,activitynames,mathjaxloader.
Workaround
The only way to get the moosh command to enable a disabled filer is to:
Login as an administrator.
Navigate to Site Administration > Plugins > Filters > Manage Filters.
Execute the above-mentioned Moosh command.
The simple act of viewing the Manage Filters page does something which results in the moosh command working perfectly. Just to be clear, all I did was login and navigate to that page. I did not change any settings along the way.
What I expected
I expected to be able to enable a disabled filter without having to log into Moodle and view the Manage Filters page first.
I would be so thankful if you could please make it possible to enable filters right after a CLI installation and before anyone logs in and views pages.
Let me know if you have any questions.
Best regards,
Michael Milette
The text was updated successfully, but these errors were encountered:
I think Moosh is a great tool and really appreciate the time and effort you put into developing and making it available to the Moodle community. Unfortunately, I have come across an issue that I am really hoping you will be able to address soon.
Issue summary
I wrote a bash script that automates the installation of Moodle 3.11.7 using the CLI. The script uses Moosh v1.7 to enable plugins and pre-set many settings before the administrator logs in for the first time. I use Moosh for many things but am having trouble getting it to enable a disabled filter.
After completing the installation of Moodle, I tried to enable the Glossary Auto-Linking filter using the following Moosh command:
This results in the following error message:
Invalid filter name: 'glossary''. Possible values: displayh5p,emoticon,urltolink,mediaplugin,activitynames,mathjaxloader.
The same happens whenever I try to enable any disabled filter.
What is happening
I did a bit of investigation and discovered that the issue occurs on the following lines of Moosh’s /Moosh/Command/Moodle39/Filter/FilterSet.php file.
This line properly identifies that the Glossary Auto-Linking filter is available:
Line 40: $plugininfos = core_plugin_manager::instance()->get_plugins_of_type('filter');
However, this line seems to create an array of objects that only includes filters which are currently enabled:
Line 42: $states = filter_get_global_states();
Since $states does not include any filters that are disabled, the code execution does not itterate through the foreach loop:
Line 43 foreach ($states as $state) {
This results in the following error being displayed:
Invalid filter name: 'glossary''. Possible values: displayh5p,emoticon,urltolink,mediaplugin,activitynames,mathjaxloader.
Workaround
The only way to get the moosh command to enable a disabled filer is to:
The simple act of viewing the Manage Filters page does something which results in the moosh command working perfectly. Just to be clear, all I did was login and navigate to that page. I did not change any settings along the way.
What I expected
I expected to be able to enable a disabled filter without having to log into Moodle and view the Manage Filters page first.
I would be so thankful if you could please make it possible to enable filters right after a CLI installation and before anyone logs in and views pages.
Let me know if you have any questions.
Best regards,
Michael Milette
The text was updated successfully, but these errors were encountered: