500 View not found

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
arindbis
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Jun 15, 2008 5:18 pm

500 View not found

Post by arindbis » Sun Jun 15, 2008 5:44 pm

Hi

I am building a MVC patterned component. It works fine apart from the fact whenever I execute any task it does not get redirected to the redirect url instead gives a 500 error

a brief background of the problem,
My component's name is com_googlemap
My model's name is createmapmark
component's directory structure look like
tree.JPG
My controller look like this ..

Code: Select all

class googlemapController extends JController
{
	function display()
	{	
		$document =& JFactory::getDocument();
		$viewo = JRequest::getVar('view');
		$viewName = JRequest::getVar('task',$viewo);
		$viewType = $document->getType();
		$view =& $this->getView($viewName,$viewType);
		$model = $this->getModel($viewName,'Modelgooglemap'); //I don't really understand this function..
		if(!JError::isError($model)){
			$view->setModel($model,true);
		}
		$view->setLayout('default');
		$view->display();		
	}
}
and googlemap.php looks like this,

Code: Select all

$task = JRequest::getCmd('task');
switch( $task ){
  	case 'addmapmark':
    addmapmark();
    break;

  default:
    break;
}

// Create the controller
$controller = new googlemapController();

// Perform the Request task
$controller->execute( JRequest::getCmd('task'));

// Redirect if set by the controller
$controller->redirect();


function addmapmark()
	{		
	  global $mainframe;
	  /*binding and storing data to db here */
	  $link = JRoute::_( 'index.php?option=com_googlemap&view=createmapmark' );
	  $mainframe->redirect( $link, "Thank you for adding your fishing spot! keep sharing!!");	  		
	}
?>
whenever i execute the task all database operations are executed properly. But at the end of it i get 500 error
and the firefox url look like

Code: Select all

http://www.myfishmaps.com/index.php?option=com_googlemap&view=createmapmark
. by the way the url is same as my redirection url but & converted to &

and i have error message
500 - View not found [name, type, prefix]: googlemap,html,googlemapView
You do not have the required permissions to view the files attached to this post.

rmullinnix
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 108
Joined: Fri Nov 02, 2007 3:39 pm

Re: 500 View not found

Post by rmullinnix » Mon Jun 16, 2008 8:07 pm

On your redirect, you have no &task= option, therefore it is defaulting to a view of your component name - googlemap. You either need to specify the &task= or set a view of googlemap and provide the appropriate view.html.php and tmpl/default.php files

giannis_rx
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 05, 2007 5:49 pm

Re: 500 View not found

Post by giannis_rx » Fri Mar 27, 2009 9:18 am

Hi everyone,

I have a same problem.

The good is that local in my pc the component works perfectly.

When i install in a webserver, then i get this:

View not found [name, type, prefix]: testcomp,html,view1View

I think the problem is in the line $controller->execute( JRequest::getCmd('task') );
but it doesn't works.

Any ideas? Thanks!

Code: Select all

<?php

defined( '_JEXEC' ) or die( 'Restricted access' );

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');

$controller = JRequest::getCmd('controller', 'contr1');

switch ($controller) {

	case 'contr1':
		require_once(JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php');
		$controllerName = 'testcompController'.$controller;
		$controller = new $controllerName();
                $controller->execute( JRequest::getCmd('task') );
		$controller->redirect();
		break;	
        case 'contr2':
		require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php' );
		$controllerName = 'testcompController'.$controller;
		$controller = new $controllerName();
		$controller->execute( JRequest::getCmd('task') );
		$controller->redirect();
		break;	
	case 'contr3':
		require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php' );
		$controllerName = 'testcompController'.$controller;
		$controller = new $controllerName();
		$controller->execute( JRequest::getCmd('task') );
		$controller->redirect();
		break;
}
?>

shakura
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Mon Aug 03, 2009 7:39 pm

Re: 500 View not found

Post by shakura » Fri Sep 04, 2009 1:33 am

Man oh man, I have exactly the same problem, every thing is working fine on my localhost, and when I upload to the web server, the Error 500 kills me

User avatar
dam-man
Joomla! Exemplar
Joomla! Exemplar
Posts: 7961
Joined: Fri Sep 09, 2005 2:13 pm
Location: The Netherlands
Contact:

Re: 500 View not found

Post by dam-man » Fri Sep 04, 2009 12:44 pm

shakura wrote:Man oh man, I have exactly the same problem, every thing is working fine on my localhost, and when I upload to the web server, the Error 500 kills me
Would you please open your own topic.
Maybe some extra sample data to take a look for us.
Now we can't help you.
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards

shakura
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Mon Aug 03, 2009 7:39 pm

Re: 500 View not found

Post by shakura » Fri Sep 04, 2009 5:22 pm


FavMedia
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Tue May 25, 2010 3:56 am
Location: Inquisitive
Contact:

Re: 500 View not found

Post by FavMedia » Mon Jan 31, 2011 10:44 pm

plus 1

same deal


Locked

Return to “Joomla! 1.5 Coding”