justb3a / processwire-simplecontactform

Just a simple contact form for ProcessWire.
GNU General Public License v2.0
21 stars 6 forks source link

Uncaught Error: Call to a member function find() on null in simple_contact_form_messages.php:17 #6

Closed q2apro closed 8 years ago

q2apro commented 8 years ago

When calling the URL mysite.com/scf-messages/ I get:

Error: Uncaught Error: Call to a member function find() on null in site\templates\simple_contact_form_messages.php:17
Stack trace:
#0 wire\core\TemplateFile.php(219): require()
#1 [internal function]: ProcessWire\TemplateFile->___render()
#2 wire\core\Wire.php(347): call_user_func_array(Array, Array)
#3 wire\core\WireHooks.php(548): ProcessWire\Wire->_callMethod('___render', Array)
#4 wire\core\Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
#5 wire\modules\PageRender.module(503): ProcessWire\Wire->__call('render', Array)
#6 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent))
#7 wire\core\Wire.php(347): call_user_func_array(Array, Array)
#8 wire\core\Wire (line 17 of site\templates\simple_contact_form_messages.php) 

What could be the issue?

q2apro commented 8 years ago

Fixed it by editing the simple_contact_form_messages.php:

Replace:

 $currentPage = $this->pages->findOne("template=simple_contact_form_messages"); 

with:

$currentPage = $this->pages->get('/scf-messages/'); 

This should get a fix in the code.

justb3a commented 8 years ago

Thanks for reporting. Since a lot has changed in the latest version this is no longer part of the module.