Whenever I am creating or editing my page Content Type and go into preview mode I see these errors:
And here is the code for it:
The dark theme does not show up in preview mode though. However, if I ignore the errors and create my page, the dark theme works and everything seems to be displayed correctly. When is the template_preprocess_html() function called and where in Drupal is it called. Also, any tips on how to debug the code would be appreciated (new to PHP).