?
avatar mojazz
mojazz
1 May 2017

Steps to reproduce the issue

Attempt to submit a custom component form and save a record.

Expected result

Record saves and page redirects to empty form

Actual result

Returns HTTP 500

System information (as much as possible)

Joomla! 3.7 upgraded from 3.6.5
PHP 7.1.4

Additional comments

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.

avatar mojazz mojazz - open - 1 May 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 May 2017
avatar mojazz mojazz - change - 1 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-01 01:10:53
Closed_By mojazz
avatar mojazz mojazz - close - 1 May 2017
avatar mojazz
mojazz - comment - 1 May 2017

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.

Add a Comment

Login with GitHub to post a comment