Hotpot bodystyles setting and nopermission error

Hotpot bodystyles setting and nopermission error

Paul Nijbakker གིས-
Number of replies: 7

Hi,

We have run into a problem that seems due to us specifying the (new) bodystyles setting in one site. All hotpots now display the following error:
Sorry, but you do not currently have permissions to do that (View the entry page of a HotPot activity)

More information about this error

Debug info: 
Error code: nopermissions
Stack trace:
  • line 704 of /lib/accesslib.php: required_capability_exception thrown
  • line 45 of /mod/hotpot/view.php: call to require_capability()

This would not be so bad if there was a way to reset the bodystyles to "none", but there is no such option. It seems we have to delve into the server files to manually fix this.

Rgrds,
Paul.

དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to Paul Nijbakker

Re: Hotpot bodystyles setting and nopermission error

Paul Nijbakker གིས-

Hi again,

Unfortunately, while we managed to take away the bodystyles setting via the database (mdl-config table) this did not solve the problem (even after purging all cache). It is really unfortunate, for this is the only difference there was in the module between the installation where hotpot still works and the one where it stopped working. We have the very last version of the plugin (...50) in Moodle 2.3.2+ The affected site contains 461 hotpot quizzes. The error ocurs both in exisiting hotpots as in newly created ones.

Does anyone have any suggestion as to what we should be looking for?

 

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: Hotpot bodystyles setting and nopermission error

Gordon Bateson གིས-
Core developers གི་པར Peer reviewers གི་པར Plugin developers གི་པར

The new bodystyles do not rely on permissions, so I see no connection there.

If you want to unselect any of the body styles, just uncheck them (Ctrl - click). No magic and no devling in to files or use of SQL commands required.

There error says that the user does not have permission, so I suggest you start by checking what role the user who got the message was using when the message appeared. Then check the site role definitions (Settings -> Site administration -> Users -> Permissions -> Define roles). Find the role you are interested in and click the "Edit" button. Locate the setting for the "mod/hotpot:attempt" capability, and set it to "Allow". If that was already set to "Allow" then, you'll need to check the Course user permissions in the same way and check that there are no permission overrides.

You can do all of this via the standard Moodle interface. There is no need to "delve into the server files".

Please let us know if checking/changing the permissions resolves the issue for you.

Rgrds,
Gordon.

In reply to Gordon Bateson

Re: Hotpot bodystyles setting and nopermission error

Paul Nijbakker གིས-

Hi Gordon,

Thanks for your reply. I did not know that Ctrl-click trick.

The problem affects all users (all roles) in the affected site. I find when I check the permissions that hotpot is entirely gone from the permissions table, while it is still present in the the site that still works. Both sites are the same version of Moodle in the same server with the same version of hotpot, upgraded on the same day. I received no errors while upgrading. How is it possible that all those permissions simply vanished? (And how do I get them back?)

Bodystyles was my prime suspect, because, as I mentioned, it was the only difference between the module in the site where it still works and the site where the permissions have disappeared.

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: Hotpot bodystyles setting and nopermission error

Gordon Bateson གིས-
Core developers གི་པར Peer reviewers གི་པར Plugin developers གི་པར

Hi Paul,
probably you can get your HotPot styles back if you go to the database, in the "mdl_modules" table, locate the "hotpot" row, and set the "version" field to "2010080332".

Then, log in to Moodle as admin. The update should start automatically, but if it doesn't, navigate to Settings -> Site administration -> Notifications.

Please try that, and let us know if it works.

good luck!
Gordon

In reply to Gordon Bateson

Re: Hotpot bodystyles setting and nopermission error

Paul Nijbakker གིས-

Hi Gordon,

Thanks for this tip; the re-install/upgrade brought back the missing permissions/database tables. I must remember that, if something similar happens in the future. I remain mystified as to how they could have been removed in one site and not in the other.

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: Hotpot bodystyles setting and nopermission error

Gordon Bateson གིས-
Core developers གི་པར Peer reviewers གི་པར Plugin developers གི་པར

Paul,
thanks for confirming that you were able to get your HotPot capabilities back.

I have not seen or heard of that happening before. If you have backup of the scripts + db + files, you could try going back to the previous version checking that HotPot capabilities are there, redoing the upgrade and checking that the capabilities have gone. That would be a good first step in tracking down what exactly happened. I could well understand though if that sounds like too much effort, or even impossible if we don't have the backups to go back to.

best regards
Gordon

In reply to Gordon Bateson

Re: Hotpot bodystyles setting and nopermission error

Paul Nijbakker གིས-

Hi Gordon,

Sorry, I missed your reply. You are right, the operation of redoing the upgrade is a little beyond me. I do not have that level access to the server (the back-up part) and as it concerns our main production site, I do not want to touch it more than necessary.

Rgrds,
Paul.