500 view not found, but view exists

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
qson
Joomla! Intern
Joomla! Intern
Posts: 84
Joined: Sun Mar 05, 2006 9:02 pm

500 view not found, but view exists

Post by qson » Wed Jun 25, 2008 12:59 pm

Working on a webmail client component with MVC, and so far it have worked well, but yesterday i ran into a 500 view not found.
The thing is, the view exists, and it worked some days ago and nothing changed since. I have created several other views, which also returns 500 view not found, except one which works. I tried duplicating this view and renaming it to one that did not work, but still 500 view not found.

Found out something right now: The JMailViewCompose works fine, and if I download it, rename the folder and class name to JMailCompose2, and upload it as a new view, it does not work. However if I rename the existing JMailViewCompose to JMailViewCompose2 and rename the folder, it works. Then if I upload my downloaded copy, this one does not work.
I can't even create new views. I created a folder "test" and inside it a "view.html.php" with just a class named JMailViewTest with the display(){parent::display();} inside. This gave me the 500 view not found when trying to reach index.php?option=com_jmail&view=test

What is this. It worked fine until yesterday...

Please help!

blixz
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Dec 17, 2007 4:20 pm

Re: 500 view not found, but view exists

Post by blixz » Thu Jun 26, 2008 10:27 am

Hi,

There are some things you have to be careful about when naming the views.
You said you renamed JMailViewCompose to JMailCompose2, uploaded JMailCompose2 as a new view, and that didn't work. That is because when you have and url like this: index.php?option=com_jmail&view=compose2 joomla you look for a view.html.php file in components/jmail/views/compose2/view.html.php. And the class name in view.html.php needs to be JMailViewCompose2.

The rule is (if you're using the JController's default display method, which by your description you probably are): the name of the controller without the 'Controller' part substring at the end, followed by View followed by the view name. In your case the controller name is JMailController, and the view name is compose2, so the view class name has to be JMailViewController2.

The view folder name has to be in lowercase always(in your case: compose2). This is important because you won't get an error if you're folder name isn't all lowercase and you're testing in a windows environment (not case sensitive). But when you put in your server, probably running linux you'll get that "500 view not found" error because linux is case-sensitive.

You can read all about how to name the views and the class names here: http://www.joomladevuser.com/tutorials/ ... -dev-parti.

blixz

qson
Joomla! Intern
Joomla! Intern
Posts: 84
Joined: Sun Mar 05, 2006 9:02 pm

Re: 500 view not found, but view exists

Post by qson » Thu Jun 26, 2008 3:05 pm

Sorry 'bout the compose2-thing. This was only for testing purposes. I also created a test view called JMailViewTest, with code that worked long before...

I gave it a night, and though it did not work this morning (why would it), I did not give up, so I downloaded all files, uninstalled the component, created a new install package and installed the component. Now everything works fine! Note that I did not change any files, filenames or directories. Just re-installed the component...

Thanks for all help...
I'll be in touch ;)

mikegrungey
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Mon Aug 11, 2008 3:16 am

Re: 500 view not found, but view exists

Post by mikegrungey » Mon Oct 06, 2008 10:03 am

this thread help me a lot!

now i know in linux environment all folder should be name in lowercase.

thanks guys

presto5
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Mon Jan 14, 2008 8:09 pm
Contact:

Re: 500 view not found, but view exists

Post by presto5 » Tue Jun 09, 2009 3:30 pm

For somebody who will have this problem in the future:

Looks like i found the reason why it might not work even if you have your controller and view classes, files and folders named properly.
What i did is i installed some component using Joomla installer. After that i added controller and view and they did not work showing me "500 view not found" error. I thought i have permissons problem and set permissons to ENTIRE com_test folder to 777 and it did not work again. After that i decided to apply same user and group for component folder just in case and ... mirracle!!! It worked!!!
What does it mean? Does Joomla checks for files to have same linux user? What for?
Once again: permissions were set to 777.
http://www.bestdatamanager.com/ - Develop with Joomla TWICE FASTER

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: 500 view not found, but view exists

Post by ianmac » Tue Jun 09, 2009 5:01 pm

presto5 wrote: What does it mean? Does Joomla checks for files to have same linux user? What for?
No, Joomla! doesn't. But perhaps your system was denying access for some reason?

Ian


Locked

Return to “Joomla! 1.5 Coding”