Save function and SEF-urls
Posted: Mon Jan 14, 2008 11:05 pm
I'm having some serious troubles... I've created a component that registered user can submit inforation to from the frontend. This works fine and dandy when SEF is not turned on but as soon as I turn it on I get:
At the bottom it says:
Do I read that correctly that it's looking for a view called frontpage? If so, why?
In the component.php-file I have this:
and the task looks like this:
This works perfectly with and without SEF when using a link from the menu.
My save function looks like this:
It still saves the entry in the database despite throwing this error. So basically it stores the database and then gives an error about the view.
Could someone help figure out whats wrong?
(The most annoying part is that I want to believe that it has worked before with SEF-urls but something has change I can for my life not figure out what.)
Code: Select all
500 - View not found
Code: Select all
View not found [name, type, prefix]: frontpage,html,callistoView
In the component.php-file I have this:
Code: Select all
$controller->registerDefaultTask('display');
Code: Select all
function display () {
$document =& JFactory::getDocument();
$viewName = JRequest::getVar('view','events');
$viewType = $document->getType();
$view = &$this->getView($viewName, $viewType);
$model = &$this->getModel('default' );
if (!JError::isError( $model )) {
$view->setModel( $model, true );
}
$view->setLayout("default");
$view->display();
}
My save function looks like this:
Code: Select all
function save () {
$option = JRequest::getCmd('option');
$itemid = JRequest::getCmd('itemid');
$post = JRequest::get('post');
$row =& JTable::getInstance('Callisto', 'Table');
if (!$row->bind($post)) {
return JError::raiseWarning(500, $row->getError());
}
if (!$row->store()) {
return JError::raiseWarning(500, $row->getError());
}
$this->setRedirect('index.php?option=' . $option . '&itemid=' . $itemid);
$this->setMessage('Händelse inlagd');
}
Could someone help figure out whats wrong?
(The most annoying part is that I want to believe that it has worked before with SEF-urls but something has change I can for my life not figure out what.)