Plugin settings

Plugin settings

by Yunus Zaytaev -
Number of replies: 13

Hello!

I've faced with a trouble:

I'm developing plagiarism plugin and when the plugin is successfully installed I don't see Settings link on Plugins Overview page. Moodle version is 3.0. Previously with Moodle 2.9 everything was OK.

Also I've tried to install other plagiarism plugins, and don't see Settings link for them as well, please see screenshot attached, CheckItNow is mine.

I've tried to Google it, but unsuccessful. I guess that there is some 'magic' button, don't know where
Thanks in advance!

Attachment plag-plugin.png
Average of ratings: -
In reply to Yunus Zaytaev

Re: Plugin settings

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Are you confident you have a settings.php file in the root of your plugin. Can you turn debugging to developer and then re-request that page.

In reply to Marcus Green

Re: Plugin settings

by Yunus Zaytaev -

Hi, Marcus!

Yes, I have settings.php in the root, both for my plugin and others
I've turned debugging - DEVELOPER level with displaying debug messages
Page /admin/settings.php?section=checkitnow gives me:

Debug info: 
Error code: sectionerror
Stack trace:
  • line 488 of /lib/setuplib.php: moodle_exception thrown
  • line 6829 of /lib/adminlib.php: call to print_error()
  • line 51 of /admin/repository.php: call to admin_externalpage_setup()
and page http://10.90.104.24/admin/settings.php?section=plagiarism_checkitnow gives similar:

Debug info: 
Error code: sectionerror
Stack trace:
  • line 488 of /lib/setuplib.php: moodle_exception thrown
  • line 23 of /admin/settings.php: call to print_error()


In reply to Yunus Zaytaev

Re: Plugin settings

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I suspect the error from checkit_now was preventing you seeing the settings options in the others.  I suspect you have an error around line 51 of your settings.php file but without the source code it is hard to tell.

In reply to Yunus Zaytaev

Re: Plugin settings

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I get an error that looks like that when my login expires and I try to access a settings page. I guess thats not it in this case though.

It might be that loading the settings pages is failing, as Marcus suggested, because there is a typo or problem in the checkit plugin's settings page. Can you try removing it temporarily, or commenting out almost all of it, and see if that makes a difference? 

In reply to Justin Hunt

Re: Plugin settings

by Yunus Zaytaev -

You mean remove plugin or settings.php?
I've re-install the plugin a couple of times with the same result, purged caches and restart Apache

I've remove all lines (with purging caches) except these:

require_once(dirname(dirname(__FILE__)) . '/../config.php'); 

require_once($CFG->libdir.'/adminlib.php');

require_once($CFG->libdir.'/plagiarismlib.php');

require_once($CFG->dirroot.'/plagiarism/checkitnow/lib.php');

equire_once($CFG->dirroot.'/plagiarism/checkitnow/plagiarism_form.php');

require_login();

admin_externalpage_setup('plagiarismcheckitnow');

And result is like that:

Debug info: 
Error code: sectionerror
Stack trace:
  • line 488 of /lib/setuplib.php: moodle_exception thrown
  • line 23 of /admin/settings.php: call to print_error()
Also I'm confused - PlagScan and Vericite do not work as well


In reply to Yunus Zaytaev

Re: Plugin settings

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

At the moment I am not sure which line in settings is causing the error. When faced with this problem I tend to put a line containing 

exit();

Towards the top of the file, then refresh the page to see if I get an error (at first you get nothing at all of course),

I then move the exit down the page (typically two lines at a time), until I get the error, which means I know approximately where the error is being triggered. Crude but it works.

Average of ratings: Useful (1)
In reply to Yunus Zaytaev

Re: Plugin settings

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Have you checked the permissions on the plugin folders by chance?  Are you installing through the web interface or directly adding the folder on the server?

In reply to Emma Richardson

Re: Plugin settings

by Yunus Zaytaev -

Hi, Emma!
I've solved my problem, I forgot to enable plagiarism plugins in advanced features.
Coping with the trouble, I looked through the documentation, searching for errors in my plugin, but e.g. https://docs.moodle.org/dev/Plagiarism_plugins does not say about this checkbox.
Maybe it would be good to add one sentence about it somewhere smile I think as Documentation Writer you know the best place for it smile

In reply to Yunus Zaytaev

Re: Plugin settings

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Glad you fixed it.  I added where to enable in the documents but anyone (including you!) can change the docs if you think it should be made clearer!

First time I realized that I am a document writer!!  Lol.

In reply to Yunus Zaytaev

Re: Plugin settings

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Commenting as I just had the exact same error message locally (with an assignment feedback plugin).

In my case, it was because the plugin had some upgrade steps that needed running - so visiting 'site admin > notifications' sorted it out. This may not help in your case, but sharing in case it does.

Average of ratings: Useful (1)
In reply to Davo Smith

Re: Plugin settings

by Yunus Zaytaev -

Hi, Davo!

You know, notifications themselves didnot help me, but your idea led me to Administration -> Advanced Features and I saw checkbox for enabling plagiarism plugins. It solved my problem! smile
Probably with Moodle 2.9 I've checked it and forgot - it was 3 months ago

Thank you, Davo, Marcus, Justin!

Average of ratings: Useful (1)