Hi Admin,
the builder 2.5 is FANTASTIC, the fork feature works great, I know there are few bugs, but it's matter of time, all will be fixed.
I saw the XML files for forms are not included in the great FORK feature, so here my way to do it:
added in the classes item.php file.
protected function preprocessForm(JForm $form, $data, $group = 'content'){
$baseFolder = JPATH_COMPONENT . '/fork/models/forms/';
$formFile = $baseFolder . $this->view_item .'.xml';
if (file_exists($formFile))
{
$xml = simplexml_load_file($formFile);
$form->load($xml, true);
}
parent::preprocessForm($form, $data, $group);
}
Surely there are other ways to do it, but this was the first I thought and it's clean and perfectly working.
So in this way, the fork xml file, is parsed against the original xml form file, if there are same fields, they are replaced by the fork file, otherwise they are added
.
this is a good option if we wanna add new fields in the form (but they need to be processed "before save" and on "getItem") for the "Object (JSON)" field.
thank you for your work.