Syntax error: unexpected end of file in layout/secure.php

Issue #959 resolved
Mike Kelly created an issue

Students attempting to write a quiz ran into a syntax error, on line 64 of layout/secure.php (Adaptable version 2018112300, Moodle 3.5.3), when viewing /mod/quiz/attempt.php. Exact error:

Default exception handler: Exception - syntax error, unexpected end of file, expecting ',' or ';' Debug: Error code: generalexceptionmessage * line 64 of /theme/adaptable/layout/secure.php: ParseError thrown

Looking at that file, it appears that a php block isn't closed correctly (and a semi-colon is missing):

<script type="text/javascript">
    <?php echo $PAGE->theme->settings->jssection;?>
</script>
<?php echo $OUTPUT->standard_end_of_body_html()

I compared it to an earlier version of that file and other code has changed so I'm not sure if there are additional lines missing, or if the unterminated block is the only issue.

```

Comments (7)

  1. Graham Becker

    I am having the same issue, i added a ; to the "echo $OUTPUT->standard_end_of_body_html()" statement and so far that appears to have fixed the issue for me running PHP 7.2

  2. Info 3bits

    Thanks for reporting.

    The right code must be:

    <?php echo $OUTPUT->standard_end_of_body_html();
    

    We'll publish a new release soon for moodle 3.6 and it will be fixed for 3.5 too

  3. Log in to comment