Drupal - access errors
Our Drupal 7 site recently stared displaying 'access denied' errors when displaying a page with H5P content,
A check of the log showed the url causing the error is apparently from an ajax call - a typical url looks like: http://copyoftest7.site.edu/h5p-ajax/content-user-data/15752/state/0 - all of the 'access denied' errors have a 'h5p-ajax/content-user-data/(node)/state/0' pattern. The content displays without any problem.
We enabled the 'trim trailing zero' option in the global redirect module, which changed the error from 'access denied' to a 'page not found', a slight improvement but not the solution. So before I dig into the code I'm opening this thread for any ideas anybody might have. Thanks in advance.
fnoks
Mon, 07/13/2015 - 07:17
Permalink
This ajax call is run
This ajax call is run whenever user data is saved or fetched. It is run even if the user is not logged in, but the Drupal endpoint requires the user to be logged in, therefore it fails with access denied. This will not have any other consequences than the js-error message displayed in the browser.
I have created an issue for this - hopefully a fix will be part of the next release!
Thanks for reporting!
edmoran
Tue, 07/14/2015 - 18:28
Permalink
Save Content State setting
It turns out the 'save content state' setting, in config/system/h5p, has to be set.. it was reset in our case.
AFter enabling the setting (and turning off the trailing zero trimming in global redirect, see above) everything has returned to normal. Sorry for the panic post, too, and I imagine there will be others who will follow in my path and may benefit from my few hours of painfully aquired wisdom.
Thanks again for your help!
fnoks
Wed, 07/15/2015 - 09:12
Permalink
Then probably my previous
Then probably my previous comment was not correct. Anyways, we now have an issue in our backlog to figure out what was going on here so that others don't have to experience the same problems!
Thanks for the follow-up! We are thankful for all feedback - it makes H5P better!
edmoran
Fri, 07/17/2015 - 18:43
Permalink
It turns out that the above
It turns out that the above fix may not completely eliminate the problem, (ie, access denied errors while running H5P modules). The errors appeared again after enabling organic groups, and turning off the 'organic groups - field access' setting stopped the error.
These errors have been happening only for Anonymous users, authenticated permissions and above run error-free. Matching permissions (anon users boosted to match auth) does not affect the problem. Also, the page may have to be refreshed after first load to induce the error, and the error may appear on the following page upon load if you click away.
Now that I have a better scope of the problem I'll start digging in, I'll keep you posted. And if any readers have any experience with this little enigma, let me know.. I'm a relative newb w/ Drupal and I'm "learning by undoing" here. =]
falcon
Mon, 07/20/2015 - 10:16
Permalink
Thank you for sharing your
jvengen
Wed, 04/20/2016 - 15:29
Permalink
Access denied for anonymous and authenticated users in drupal
Hi, I am having problems with accessing h5p content for anonymous users as well as authenticated users in drupal. Every other content type works, but I am having problems with interactive content. I am always getting the 'You are not authorized to access this page'. So far, only the siteadmin can access interactive content. I might have overlooked something, I suppose? Any help?
falcon
Wed, 04/20/2016 - 21:36
Permalink
You might be using quiz_h5p?
jvengen
Thu, 04/21/2016 - 19:14
Permalink
Without Quiz core?
Would you advice me to disable the Quiz H5P Integration module and use H5P as a stand-alone instead?
falcon
Tue, 04/26/2016 - 00:55
Permalink
If you need Quiz's features
jvengen
Tue, 04/26/2016 - 12:01
Permalink
Thanks!
Thank you for your answer!