/** * Constructs the form. * @param null $action * @param null $customdata * @param string $method * @param string $target * @param null $attributes * @param bool $editable */ public function __construct($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null, $editable = true) { $customdata['categoryid'] = $customdata['category']->id; $customdata['parent'] = $customdata['category']->parent; unset($customdata['category']); parent::moodleform($action, $customdata, $method, $target, $attributes, $editable); }