Steve_Stifler Posted March 1, 2019 Posted March 1, 2019 (edited) Where do I find out what errors mean? I keep getting this error when I try to have a page use HTML: (IT is in White, for some reason I can't change the text colour) Fatal Error: Uncaught Error: Call to a member function and() on null in /home2/investo5/public_html/site/templates/_main.php:49 Stack trace: #0 /home2/investo5/public_html/wire/core/TemplateFile.php(297): require() #1 /home2/investo5/public_html/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #2 /home2/investo5/public_html/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___render', Array) #3 /home2/investo5/public_html/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #4 /home2/investo5/public_html/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #5 /home2/investo5/public_html/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #6 /home2/investo5/public_html/wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___renderPage', Array) #7 /home2/investo5/public_html/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderP (line 49 of /home2/investo5/public_html/site/templates/_main.php) Edited March 1, 2019 by teppo Edit: fixed text colour.
teppo Posted March 1, 2019 Posted March 1, 2019 That error is a generic PHP error message, so making sense of it requires some basic PHP debugging skills. There's no manual here – just read the message, see what it is related to, and try to figure it out from there. Google is your best friend when debugging PHP code ? The message here is rather clear: Quote Fatal Error: Uncaught Error: Call to a member function and() on null in /home2/investo5/public_html/site/templates/_main.php:49 In other words you're trying to call function and() on a null value in your _main.php file, line 49. The exact reason is impossible to say without seeing the code, but my guess so far would be that you're grabbing a page or something like that, and not actually checking that it has a valid value before trying to use it as an object. 4
dragan Posted March 1, 2019 Posted March 1, 2019 if it's this line from the "regular" site profile, maybe you don't have any pages other than home? https://github.com/processwire/processwire/blob/dev/site-regular/templates/_main.php#L45 <?=ukNavbarNav($home->and($home->children), [
Autofahrn Posted March 1, 2019 Posted March 1, 2019 If this is the line with the error, then $home would be null.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now