I've added a custom field to com_content, and everything has been working wonderfully. I'm now trying to add some server side validation, and after following all the tutorials and examples I've been able to find, specifically this one, it is failing because the rule isn't being found
The desired rule is almost identical to validating a Username, so I copyied/renamed that as my starting point. The files/paths DO exist, and load/save is working properly.
Is there additional information that I'm not providing or perhaps fresh eyes that will make me feel foolish when it's pointed out?
From the B/E, clicking on "Save" produces this error:
An error has occurred.
0 JForm::validateField() rule mycode
missing.
Custom Field XML (Works as expected, except server validation)
<?xml version="1.0" encoding="utf-8"?>
<form addfieldpath="/administrator/components/com_mycomponent/models/rules">
<fields name="params">
<fieldset name="MyFields" label="My Info">
<field name="my_code"
type="text" size="15"
validate="mycode"
label="My Code"
/>
</fieldset>
</fields>
</form>
/administrator/components/com_mycomponent/models/rules/mycode.php
//jimport('joomla.form.formrule'); does not work with or without this
class JFormRuleMycode extends JFormRule
{
public function test(SimpleXMLElement $element, $value, $group = null, JRegistry $input = null, JForm $form = null) {
return true;
}
}