Can anyone help me with this error?
I must have some difference in installs or server settings of Joomla 2.5.11, because I see this error on one install and not the other, but I am really looking to resolve it rather than figure out why it shows up on one of the installs.
Notice: Undefined property: JFormFieldStatefk::$class in /var/www/html/joomla.test/libraries/joomla/form/field.php on line 250
It relates to the custom field statefk which is a state value I'm using to preserve a foreign key. The state value was getting lost sometimes, and so I was outputting it in a read only field.
The xml code of the field is:
<field name="parentGroup_id"
type="statefk"
label="FORMFIELD_STATEFK_WARNING"
fkstate="com_mycomponent.parentGroup"
default="0"
class="readonly"
/>
and the field's code is:
class JFormFieldStatefk extends JFormField {
protected $type = 'statefk';
// getLabel() left out
public function getInput() {
$fk = JFactory::getApplication()->getUserState($this->element['fkstate'], $this->element['default']);
$input = '<input type="text" id="'.$this->id.'" name="'.$this->name.'"';
if ($this->class) {
$input .= ' class="'.$this->class.'"';
}
$input .= ' value="'.$fk.'"';
$input .= 'size="4" readonly="readonly" />';
return $input;
}
}
The error points to the __GET method which is a switch command and fkstate is obviously not in the list of switch options, but when I changed fkstate to value, I still got the error, and I should be able to have mine own properties in a custom field, right?