function _actionApply(KCommandContext $context) { $this->uploadFile($context); return parent::_actionApply($context); }
/** * Apply action * * This function wraps around the edit or add action. If the model state is * unique a edit action will be executed, if not unique an add action will be * executed. * * Overriding Nooku Framework here, as there is a bug that stops the id being appended to new items * * @param KCommandContext A command context object * @return KDatabaseRow A row object containing the saved data */ protected function _actionApply(KCommandContext $context) { $result = parent::_actionApply($context); $identifier = $this->getIdentifier(); //if this is a new item result is a row, else if its an edit its a rowset $id = isset($result->id) ? $result->id : key($result->getData()); //force the url to take the id $this->_redirect = 'index.php?option=com_' . $identifier->package . '&view=' . $identifier->name . '&id=' . $id; return $result; }