asprin
Active member
So I'm using a validation callback to validate the value entered by the user in my addon's option page.

The Options.php class is as follows:
	
	
	
		
Now when I try to save a value on the options page, I'm getting the following error:
I know that it's referring to the second argument of the callback function, but doesn't the
				
			
The Options.php class is as follows:
		PHP:
	
	<?php
namespace FC\Callbacks;
class Options {
    public static function validateData($field, &$value, &$error)
    {      
        $sm = \XF::db()->getSchemaManager();      
        if($sm->columnExists('xf_user', $value))
        {
            return true;
        }
       
        $error = 'Column was not found.';
        return false;      
    }
}
	Parameter 2 to FC\Callbacks\Options::validateData() expected to be a reference, value given in src\XF\Entity\Option.php at line 206
I know that it's referring to the second argument of the callback function, but doesn't the
& denote that it is being passed as reference? If not, what is the expected signature of the function?