I'm using #after_build in one of my custom module form like follows
$form['profile_image'] = array (
'#type' => 'managed_file',
'#after_build' => array("change_pic"),
);
and the function is
function change_pic($element, &$form_state, $form) {
if($form_state['values']['profile_image']['fid'] != 0){
// my code goes here..
return $element;
}
}
It's working fine in PHP 5x version. but throws the following error in PHP 7x version.
ArgumentCountError: Too few arguments to function change_pic(), 2 passed How can we handle this in PHP 7?
Any inputs would be helpful.