Page 1 of 1

Save function and SEF-urls

Posted: Mon Jan 14, 2008 11:05 pm
by deepthoughts
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:

Code: Select all

500 - View not found
At the bottom it says:

Code: Select all

View not found [name, type, prefix]: frontpage,html,callistoView
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:

Code: Select all

$controller->registerDefaultTask('display');
and the task looks like this:

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();

    }
This works perfectly with and without SEF when using a link from the menu.

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');

    }
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.)