Partial HTML output

Partial HTML output

by Mark Sharp -
Number of replies: 4
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

This is a little weird, and I'm stumped where to being to find the solution.

I'm using M3.2.3+ on Apache 2.4 (over https), PHP7, MariaDB, with Boost theme.

On some pages, but I'm finding it's regularly happening to be on the scheduler module's Overview page (/mod/scheduler/view.php?id=nnnnn&what=datelist&subpage), instead of getting a normally rendered html page, I'm getting the code (see page code below).

It doesn't happen everytime, but I have found that clicking on "My appointments" then back to "Overview" causes the error regularly.

Anyone seen anything like this and can perhaps give me a pointer?


Attachment pagecode.png
Average of ratings: -
In reply to Mark Sharp

Re: Partial HTML output

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It looks like json data that's gone astray. My guess would be that some error has screwed up the page rendering and you are seeing this data that you shouldn't.

My first step would always be to turn up Debugging, reproduce the error and then check the end of my web server's error log. If you are lucky you will get a clue. 

It might also be worth checking your browser's javascript console when the page is rendered. 

In reply to Howard Miller

Re: Partial HTML output

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Howard. The error log isn't showing anything unusual. 

So, this example is showing json at the top, but that's just part of the normal get_head_code() from outputrequirementslib.php, and then the rest of the html is produced. What's interesting is that the top of the html page is missing i.e. the <html><head> bit.

The response headers show a response of 200, but doesn't show the content type (see image)

I don't know if there's a problem with this function, or perhaps a memory issue, or perhaps gzip, or https.

Attachment schedulerpageload.png
In reply to Howard Miller

Re: Partial HTML output

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Suspecting there might be a problem with outputting the json, I've tried disabling some of the javascript plugins - filters, atto plugins, but not much joy. I wonder if json_encode might be having issues, but I'm not getting any error messages popping up anywhere, just partial header.

In reply to Mark Sharp

Re: Partial HTML output

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

In the end I switched off https and the problems seemed to go away. A bit concerning that https should cause an issue.