Stack trace:
#0 /home/user/public_html/site/core/components/formz/processors/mgr/tv/output/formz.class.php(15): modX->runSnippet('fmzForms', NULL)
#1 /home/user/public_html/site/core/model/modx/modtemplatevar.class.php(1140): FormzOutputRender->process('', Array)
#2 /home/user/public_html/site/core/model/modx/modtemplatevar.class.php(442): modTemplateVarRender->render('', Array)
#3 /home/user/public_html/site/core/model/modx/modtemplatevar.class.php(281): modTemplateVar->getRender(Array, '', Array, 'output', 6784, 'formz')
#4 /home/user/public_html/site/core/model/modx/modresource.class.php(834): modTemplateVar->renderOut in /home/user/public_html/site/core/model/modx/modx.class.php on line 1794
[2017-06-13 13:10:12] (ERROR @ /home/user/public_html/site/core/model/modx/modx.class.php : 1794) Recoverable error: Argument 2 passed to modX::runSnippet() must be of the type array, null given, called in /home/user/public_html/site/core/components/formz/processors/mgr/tv/output/formz.class.php on line 15 and defined
This question has been answered by multiple community members. See the first response.
It sounds like you likely have an incompatible snippet (relating to forms?) that is executing on the templates that result in a blank resource. Try to remove the snippet(s) to iscolate the problem until you find the faulty one and then update the code accordingly.
Also it might be a good idea to just omit the admin path and site url for your own security when posting here.
If you need a UI interface for your forms rather than using formit then I think Sterc/Modmore released formalicious to do exactly that.
public function process($value,array $params = array()) {
$options = array();
foreach($params as $key => $val) {
if (!empty($val)) {
$options[$key] = $val;
}
}
$mainOptions = array_merge(array('id' => $value), $options);
return $this->modx->runSnippet('fmzForms', array_merge($mainOptions, $this->tv->_properties));
}
}return $this->modx->runSnippet('fmzForms', (array) array_merge($mainOptions, $this->tv->_properties)); public function process($value,array $params = array()) {
$options = array();
foreach($params as $key => $val) {
if (!empty($val)) {
$options[$key] = $val;
}
}
$mainOptions = array_merge(array('id' => $value), $options);
$properties = $this->tv->properties;
$properties = $properties === null? array() : $properties;
return $this->modx->runSnippet('fmzForms', array_merge($mainOptions, $this->tv->_properties));
}
}$this->tv->_properties
$this->tv->getProperties()
This is the problem code:
public function process($value,array $params = array()) { $options = array(); foreach($params as $key => $val) { if (!empty($val)) { $options[$key] = $val; } } $mainOptions = array_merge(array('id' => $value), $options); return $this->modx->runSnippet('fmzForms', array_merge($mainOptions, $this->tv->_properties)); } }
Replacing the return line with this could possibly fix it, but see better fixes below:
return $this->modx->runSnippet('fmzForms', (array) array_merge($mainOptions, $this->tv->_properties));
Probably a better fix would be to change the function to this:
public function process($value,array $params = array()) { $options = array(); foreach($params as $key => $val) { if (!empty($val)) { $options[$key] = $val; } } $mainOptions = array_merge(array('id' => $value), $options); $properties = $this->tv->properties; $properties = $properties === null? array() : $properties; return $this->modx->runSnippet('fmzForms', array_merge($mainOptions, $this->tv->_properties)); } }
Another fix (the best if it works) would be to use the original code and change:
$this->tv->_properties
to
$this->tv->getProperties()
[Update] Did some quick testing, and I think the final solution above would solve things. If there are no properties, $tv->_properties is null, but $tv->getProperties() returns an empty array, which should satisfy runSnippet().
BTW, I think this may not be a PHP 7 problem, but rather a change in the error level settings when you switched. The code is a problem for any version of PHP with the current version of MODX, but a different error level may have hidden that.