gjbarnard / moodle-theme_foundation

Foundation theme for Moodle.
GNU General Public License v3.0
8 stars 0 forks source link

doctype error #23

Open miotto opened 2 years ago

miotto commented 2 years ago

If you click on the button "Purge all caches" under the URL https://moodle-url/admin/purgecaches.php, you get a doctype error.

doctype_error

In the commit abe7d596a500585b43d4abce7a6d595f5f9f2019, doctype is removed from the file layout/layout.php. When I insert the line again, the error is no longer displayed.

Test with Moodle 4.0.1+ (Build: 20220527) and foundation Version 4.0.1.1 (2022041701)

gjb2048 commented 2 years ago

Strange as https://github.com/gjb2048/moodle-theme_foundation/blob/abe7d596a500585b43d4abce7a6d595f5f9f2019/templates/partials/head.mustache#L35

gjb2048 commented 2 years ago

@miotto Is Foundation the default theme or are you switching to it via the URL?

miotto commented 2 years ago

I used Foundation as the default theme. But I did not use a newly installed Moodle 4.0, only an updated Moodle 3.11 > 4.0. I could try it tomorrow with a newly installed Moodle 4.0?

gjb2048 commented 2 years ago

@miotto Yes please, but only if you have time.

miotto commented 2 years ago

I tried a newly installed Moodle 4.0.1+ (Build: 20220527) with the Foundation Theme 4.0.1.1 (2022041701). In the Moodle setting "Appearance" > "Theme selector", I have set Foundation as the default theme. The error was displayed again.

gjb2048 commented 2 years ago

@miotto Thanks for testing and the information, interesting!

gjb2048 commented 2 years ago

@miotto Odd, identical setup and I can't replicate -> my code at -> https://github.com/gjb2048/moodle-theme_foundation/commit/72e18a65418ad0912ab2b2ddff8c79bacc1b83d7

miotto commented 2 years ago

I tried it with the same commit.

Info: In Moodle I have set the debugging to "DEVELOPER: extra Moodle debug messages for developers" and yes for "Display debug messages". The operating system is Ubuntu 20.04 with Apache 2.4.41 and PHP 7.4.3.

Currently I have created a second file layout/layout2.php with doctype. I have assigned it in the file config.php at "layouts" > "admin". With this it works.

gjb2048 commented 2 years ago

Ok, well odd as "Apache/2.4.48 (Win64) OpenSSL/1.1.1l PHP/7.4.23" on Win

  1. I do have a hunch why it could be the case though.
gjb2048 commented 2 years ago

Updated to "Apache/2.4.53 (Win64) OpenSSL/1.1.1o PHP/7.4.29" and can now replicate!

gjb2048 commented 2 years ago

@miotto Please try https://github.com/gjb2048/moodle-theme_foundation/commit/16df81dbfa73507aebade40b629ded605d18032e.

miotto commented 2 years ago

Now it works very well, thanks.

gjb2048 commented 2 years ago

@miotto Thank you, what version are you running in production please? i.e. so I know about backporting?

miotto commented 2 years ago

Our production Moodle is Moodle 3.11 with the appropriate Foundation Theme version. The error did not occur there. In the Foundation Theme Branch MOODLE_311, the doctype entry is present in the file layout/layout.php. I don't think anything needs to be changed.

I am currently testing Moodle 4 with the appropriate Foundation Theme for the next major update. And that's where the error occurred.

gjb2048 commented 2 years ago

@miotto Thanks, in that case the M3.11 version still has the double doctype issue.

gjb2048 commented 2 years ago

Still open as https://github.com/moodlehq/moodle-plugin-ci/issues/175

rogiervandongen commented 1 year ago

@gjb2048 Just an FYI, this is not limited to this theme (although not getting the error message, just a lack of a doctype). I just walked into the exact same probem with theme Boost on Moodle4.3+ (Build: 20231013) It seems to be a structural Moodle issue. Switching to theme Classic creates the exact same problem.

I started noticing it when tinyMCE would no longer load and the console states "tinymce.js:19313 Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."

This makes me think, although I'm 100% speculating, there might be something with an output buffer being cleared?

gjb2048 commented 1 year ago

@rogiervandongen I'm intrigued. What makes you think it's not a theme issue? What makes you think its an issue with the output buffer? How can I replicate the situation you describe?