Attempt to submit a custom component form and save a record.
Record saves and page redirects to empty form
Returns HTTP 500
Joomla! 3.7 upgraded from 3.6.5
PHP 7.1.4
Found that the error happens when my custom component calls $model->getForm(). After finding that disabling the System - Fields plugin allowed my form to work, I traced the issue through:
JModel::loadForm()
JModel::preprocessForm()
PlgSystemFields::onContentPrepareForm()
FieldsHelper::extract()
and found that it is the call to class_exists() on Line 55 of administrator/components/com_fields/helpers/fields.php that was causing the error.
if (class_exists($cName) && is_callable(array($cName, 'validateSection')))
{
$section = call_user_func_array(array($cName, 'validateSection'), array($parts[1], $item));
if ($section)
{
$parts[1] = $section;
}
}
I'm not entirely sure what this code is supposed to do as I can find no documentation explaining the purpose.
I found two choices to make my custom component work again... leave "System - Fields" disabled, or add the second parameter to the class_exists() call to not attempt to autoload the non-existent class.
"if (class_exists($cName, false) && is_callable(array($cName, 'validateSection')))"
I chose the latter for now. Hopefully someone can shed some light and provided clearer direction.
Thanks.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-01 01:10:53 |
Closed_By | ⇒ | mojazz |
I finally located the issue being an old piece of code in the custom component, not removed from this install, being mistakenly autoloaded and was aliasing another class.