justb3a / processwire-simplecontactform

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

Exception: Invalid value sent to Page::setTemplate #5

Closed q2apro closed 8 years ago

q2apro commented 8 years ago

I have installed the module and called it from a template with:

echo $modules->get('SimpleContactForm')->render();

Then I get:

Error: Exception: Invalid value sent to Page::setTemplate (in wire\core\Page.php line 1649)

#0 wire\core\Page.php(707): ProcessWire\Page->setTemplate(NULL)
#1 site\assets\cache\FileCompiler\site\modules\SimpleContactForm\SimpleContactForm.module(396): ProcessWire\Page->set('template', 'simple_contact_...')
#2 site\assets\cache\FileCompiler\site\modules\SimpleContactForm\SimpleContactForm.module(419): SimpleContactForm->renderForm()
#3 [internal function]: SimpleContactForm->___render()
#4 wire\core\Wire.php(347): call_user_func_array(Array, Array)
#5 wire\core\WireHooks.php(548): ProcessWire\Wire->_callMethod('___render', Array)
#6 wire\core\Wire.php(370): ProcessWire\WireHooks->runHooks(Object(SimpleContactForm), 'render', Array)
#7 site\a

I am on localhost. The site/template/ folder should be writable.

What could be the problem? I could not find setTemplate within the module files.

ProcessWire 3.0.28 devns

q2apro commented 8 years ago

Probably the error was showing up because I did not save the module and did not add all the settings.

Added the settings, saved the module, now it works!