Custom Certificate - Generates Error when changing Elements

Custom Certificate - Generates Error when changing Elements

by Jayden Tyronian -
Number of replies: 9

We recently moved our Moodle 3.6 site and while everything was copied back over and is up and running we have run into an issue with the custom certificates.

When ever we go to edit an element, we are thrown to a HTTP 500 error page (with no additional information).  

This page isn’t working

xxxxxxxxxxxxxxxx is currently unable to handle this request.

HTTP ERROR 500

The site is up and running just fine and as far as I can see all permissions are correct.  I even reinstalled the plugin in case something weird happened in the move.


When I go into the CPanel error logs, it is saying that there is a "Undefined property:stdClass::$deescription in (path)/blocks/course_contacts/block_course_contacts.php on line 268,referersadpath)//mod/customcert/view.php?id=23500"


I've reinstalled the course contacts block as well and the same problem occurred.  This was not happening on the previous location of the site and nothing has changed other than the move.  Nothing else (as yet nothing else has 'broken').  I am unsure why the custom certificate plugin would be referring to the contact block.


The code it refers to above (from line 266 to line 273) is:

code image


Can anyon help me, I've started to run out of things to try that I know of.

Thank you.

Jayden

Average of ratings: -
In reply to Jayden Tyronian

Re: Custom Certificate - Generates Error when changing Elements

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
The custom certificate does not interact with any blocks. The 'undefined property' error should not cause a HTTP 500 error. To me this seems very much like a permission issue with the files. Without being able to investigate further I can't really help out. I would visit the page that is giving you a 500 error and check your apache error logs. Good luck.
In reply to Mark Nelson

Re: Custom Certificate - Generates Error when changing Elements

by Jayden Tyronian -
Hi Mark

Thanks for getting back to me. AS far as I can see the permissions for the the plugin are correct and match what it was before.

Of some note, I can add and change a background element but none of the others yet the permissions comparison of the two is identical. I've played a little with permissions as a test and I can get the 500 to change to a 404 lol.
In reply to Jayden Tyronian

Re: Custom Certificate - Generates Error when changing Elements

by Jayden Tyronian -
All the files and folders are on the correct settings that I can see and referencing the other folders in the mod folder.

error logs on the server aren't clear. It is weird I can edit and sort the BG element of a certificate without any error, but all others get the error.

I'm really not sure where else to check now... I don't know if I completely uninstall the certificate plugin and reinstall it from scratch if that would fix things, but then means losing 100's of custom certificates in the process...

Jayden
In reply to Jayden Tyronian

Re: Custom Certificate - Generates Error when changing Elements

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Have you looked at your moodledata directory permissions? The custom certificate makes use of the function make_request_directory() in lib/setuplib.php.
In reply to Mark Nelson

Re: Custom Certificate - Generates Error when changing Elements

by Jayden Tyronian -
Hi Mark

I've had a look at that too and I'm still able to get in and edit the background element but all others I get taken to a 500 error page instead.

As far as I can see (and I'll be first to admit, I'm not a coder etc.), I have looked and checked everything and the permissions are correct based on other plugin/mod folders.

Could you or someone drill down more on where else to check and the permissions should be set at accordingly. I really don't know where else to look, and unsure why it would do this when the move was on the same webhost and same web server.

I also did a backup and full uninstall of the plugin. Installing from scratch doesn't seem to have done anything either unfortunately.

I've checked the server end error page and nothing is coming up for the custom certificate, that would be helpful either.

Jayden

But I am stuck now sad
In reply to Jayden Tyronian

Re: Custom Certificate - Generates Error when changing Elements

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Have you also checked the owner and group of the files and folders?
In reply to Mark Nelson

Re: Custom Certificate - Generates Error when changing Elements

by Jayden Tyronian -
Hi Mark

I have since upgraded Moodle so its running the latest - 3.8.

Custom certs are up and running as they should (no issues I was having previously).

However now when I go to view the certificate (be it from the manage template area, doing a test view or a student tries to download it), it takes me/the user to a a site 404 error page. I understand what the 404 means... but nothing has changed, permissions are all correct at least in the /mod/customcert folder...

Where else/what else would be (in this contect) be triggering this 404 page, that I am missing.

The following paths is what is in the address bar when it triggers the 404
/mod/customcert/view.php?id=23686&downloadissue=1014 -- via attempting to download a students certificate
/mod/customcert/view.php -- via the certificate page (that lists all the certificate generated and you click on view certificate (to generate a dummy version to look at)
/mod/customcert/edit.php -- via save changes and preview


Jayden
In reply to Jayden Tyronian

Re: Custom Certificate - Generates Error when changing Elements

by Jayden Tyronian -
Hi all

Through some playing and a last minute thought... I change the background image from a *.png file type to a *.jpg file type and it is now working again as expected!.

Is there any reason why *.png file types for background image are causing this issue?  The upload allows png files, so one would think it shouldn't bug out like that when generating the PDF...

Or is there something else, some setting elsewhere in Moodle I've missed setting up so this error doesn't occur????

Thanks heaps.

Jayden
In reply to Jayden Tyronian

Re: Custom Certificate - Generates Error when changing Elements

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Seems I will have to play around with it myself when I get some time. It doesn't sound to me like you are doing anything wrong.