0

Whenever I am creating or editing my page Content Type and go into preview mode I see these errors:

enter image description here

And here is the code for it:

enter image description here

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).

0

The error is about accessing field_dark_theme from an un-existing node instance. The proper way of loading the node during preview is explained here.

On the other hand, welcome to the wonderful world of PHP for debugging properly (on Drupal), please check this post and this documentation entry check your proper IDE/stack on how to setup debugging tools.

  • Thank you! This looks like what I needed. I'll be looking into it but may have more questions haha really appreciate it though! – Joe Spinelli Jan 16 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.