This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Day 7: 404 error

Discussion around this tutorial for symfony 1.2-1.4

Day 7: 404 error

by DJBNET » Tue Dec 14, 2010 2:28 am

Here we go again. I'm on Day 7 and I'm getting another error.

"Unable to find the JobeetCategory object with the following parameters "array ( 'slug' => 'programming',)")."

I've looked over all of my code to make sure I didn't miss anything. I even ended up copying and pasting all the example code and I'm still not getting anything. Any ideas?
DJBNET
Junior Member
 
Posts: 12
Joined: Mon Dec 06, 2010 9:26 pm

Re: Day 7: 404 error

by Vicrabb » Tue Dec 14, 2010 10:37 am

First of all, are you sure you copied/pasted in the right files?

If yes, check the other files from the previous days, mainly those concerning the slug and the category (the categories.yml).

For my part, I can't really help you - I didn't had that problem.

Besides your error seems weird:
- array is having two ending )
- there is a , in the array, like if it was expecting a second entry

Did you copy/paste that error?
Netbeans 6.9- Mysql Workbench 5.2
Symfony 1.4.8
Wamp server 2.0 (=>PHP 5.3.0, Apache 2.2.11, Mysql 5.1.36, phpMyAdmin)
Windows XP/7 (depending on where I am)
Firefox 3.6 - Chrome (some IE8, rarely Opera and Safari, testing Rockmelt at home)
Vicrabb
Junior Member
 
Posts: 13
Joined: Mon Nov 22, 2010 1:10 pm
Location: Belgium

Re: Day 7: 404 error

by DJBNET » Tue Dec 14, 2010 2:40 pm

I checked through it all again and I'm still getting the same error. I checked and triple checked all the previous chapters as well as all the code in the current chapter to make sure it is correct and that it's going to the right place so I figured it would be a database error. I checked the database and everything appeared fine. The only thing that looked suspect was the entries in the SLUG column of the Jobeet_Category database. In the schema YAML file, I've clearly written names to be 'notnull' and yet they appear as NULL in their entries. Could this have anything to do with this error?
DJBNET
Junior Member
 
Posts: 12
Joined: Mon Dec 06, 2010 9:26 pm

Re: Day 7: 404 error

by DJBNET » Tue Dec 14, 2010 3:46 pm

I might just have to do the whole tutorial again. I'm not sure what I could be doing to cause this, but here's the only thing I can find. I noticed that when I remove the following code:

Code: Select all
public function getSlug()
{
  return Jobeet::slugify($this->getName());
}


from the JobeetCategory.class.php file, it gives me this error:

Empty module and/or action after parsing the URL "/category/" (/).

Here's what I think is happening. This appears in the URL: http://localhost:8080/frontend_dev.php/category/ - At this point, the code does not know how to get the slugified version of the category name. Instead, the object appears empty. Even if you put in a category name that happens to exist, ie http://localhost:8080/frontend_dev.php/ ... rogramming - it gives me an error as if that category does not appear in the database. I know both errors could be a result of the same flaw, but what I don't understand is how I could complete all the code exactly and still get this error.

With this new information, can anyone help me out?
DJBNET
Junior Member
 
Posts: 12
Joined: Mon Dec 06, 2010 9:26 pm

Re: Day 7: 404 error

by andry » Sun Dec 19, 2010 6:59 pm

When I delete de cache and the logs with a browser or with a comment an unix/linux command such as :
$ rm -r cache/* log/*
Then nothing goes well.

As a know it, it should not hurt the application, however, the same issue as above appear.
I thing that it must be fixed as soon as possible...

I know for certainty that people may look somewhere else if this could not be fixed.
I want to ask if there are any correct official jobeet compressed files which could be downloaded there?
So, could we test it at best...

Thanks
andry
Junior Member
 
Posts: 4
Joined: Sun Dec 19, 2010 6:51 pm

Re: Day 7: 404 error

by andry » Sun Dec 19, 2010 7:02 pm

DJBNET wrote:"Unable to find the JobeetCategory object with the following parameters "array ( 'slug' => 'programming',)")."

I've got the same issue.
May be was it the doctrine thing?
andry
Junior Member
 
Posts: 4
Joined: Sun Dec 19, 2010 6:51 pm

Re: Day 7: 404 error

by claudia_k » Sun Dec 19, 2010 7:37 pm

@DJBNet

Regarding:
"Unable to find the JobeetCategory object with the following parameters "array ( 'slug' => 'programming',)")."

You need to remove the method getSlug from JobeetCategory once you have set the Sluggable behaviour for JobeetCategory and rebuilt the database. Otherwise you will this error.

Regarding:
Empty module and/or action after parsing the URL "/category/" (/).

This error can have several reasons. If your test url is 'http://localhost:8080/frontend_dev.php/category/' the error happens because there is no category in the url (example: http://localhost:8080/frontend_dev.php/ ... rogramming). If you want your url to work even without a valid category you need to provide a default for the category parameter in the routing.yml (afaik).

Regarding:
Even if you put in a category name that happens to exist, ie http://localhost:8080/frontend_dev.php/ ... rogramming - it gives me an error as if that category does not appear in the database
Here I need to see the error message - without that it is difficult to say what is going on.


@andry:
Then nothing goes well.
What exactly is the problem when you empty the cache like this?

I want to ask if there are any correct official jobeet compressed files which could be downloaded there?

Not official at all, but here is the data for my svn repos that contains most days of jobeet: viewtopic.php?f=21&t=28230#p104251

Good luck

Claudia
claudia_k
Faithful Member
 
Posts: 265
Joined: Mon Jun 21, 2010 8:12 pm
Location: Luxembourg

Re: Day 7: 404 error

by andry » Sun Dec 19, 2010 8:03 pm

claudia_k wrote:
I want to ask if there are any correct official jobeet compressed files which could be downloaded there?

Not official at all, but here is the data for my svn repos that contains most days of jobeet: viewtopic.php?f=21&t=28230#p104251

Good luck

Claudia


Thank you...

claudia_k wrote:@claudia
Then nothing goes well.
What exactly is the problem when you empty the cache like this?

I would like to talk about this post:
The first time i've tried the tutorial, all goes well, day 7 included.
When I delete the cache this way (rm -r cache/*) then nothing was correct.
I've created again all the day 7 thing and nothings goes well...
We should have the pager working, but it does not when i click.

I've delete getSlug, of course (it's in the tutorial) but nothing goes correctly with the link to the category programming, as shown above.
May be the doctrine build from the schema.yml is not correct for us?
Code: Select all
Sluggable:
   fields: [name]
etc...

If someone have got the day 7 working correctly with cache and log deleted, tell me, and, better send us the code.
I want you to know that I do not connect to the internet when I do the tutorial.
The Symfony tree i've created is deleted by me so, it looks like a new working directory where I put again every thing, with something like this:
Code: Select all
tar --bzip2 -p -xf symfony.jobeet.tar.bz2

EVERYTHING NEEDED are in the bzip file. Then i make all the commands needed to let symfony run in the computer:
Code: Select all
symfony cc
symfony permissions # it's not needed in fact
Even the Mysql is clean (no database)
Code: Select all
symfony building the database commands...

Should the database show something with sluggable?
I mean if i open phpmyadmin, for example, there is a new column name slug? Or should we create one?
I don't know...
andry
Junior Member
 
Posts: 4
Joined: Sun Dec 19, 2010 6:51 pm

Re: Day 7: 404 error

by andry » Sun Dec 19, 2010 8:09 pm

claudia_k wrote:@DJBNet
Claudia

Is there a french forum? I do speak french... :mrgreen:
Your web page speaks french as i see it.
andry
Junior Member
 
Posts: 4
Joined: Sun Dec 19, 2010 6:51 pm

Re: Day 7: 404 error

by claudia_k » Sun Dec 19, 2010 8:31 pm

Hi andry

Day 7 works fine for me - no matter whether I have just emptied the cache and log folders or not. Code is in the svn.

Is there a french forum?

There might be some unofficial French forum around but AFAIK this forum and the Google discussion group are the only 'official' community support places.

Claudia
claudia_k
Faithful Member
 
Posts: 265
Joined: Mon Jun 21, 2010 8:12 pm
Location: Luxembourg

Re: Day 7: 404 error

by Anis3220 » Thu Jul 28, 2011 3:18 pm

Hi to all,
I'm a new member in this forum and this is my firt post ;)

@Claudia:
Regarding:
Even if you put in a category name that happens to exist, ie http://localhost:8080/frontend_dev.php/ ... rogramming - it gives me an error as if that category does not appear in the database
Here I need to see the error message - without that it is difficult to say what is going on.


I do the jobbet tutorial and all is well untel day 7 : #List Pagination
I followed the tutorial for this paragraph and I have copy and paste all the code to the end and at that point instead of showing the categorie,s it displays a 404 page:
if I type this URL: http://localhost:8080/frontend_dev.php/category/design ,for example, it displays:
404 | Not Found | sfError404Exception
Unable to find the JobeetCategory object with the following parameters "array ( 'slug' => 'design',)").


In addition, if I type "http://localhost:8080/frontend_dev.php/job" to see the home page, it displays:
design

Fatal error: Allowed memory size of 134217728 bytes exhausted (Tried to allocate 40961 bytes) in C: \ development \ sfprojects \ lib \ vendor \ symfony \ symfony-4.1.12 \ lib \ view \ sfPHPView.class.php on line 70


can any one help me please?
thank you.
Anis3220
Junior Member
 
Posts: 2
Joined: Wed Jul 27, 2011 8:20 pm

Re: Day 7: 404 error

by Anis3220 » Thu Jul 28, 2011 8:30 pm

Hi,
Finally I found the solution :)
The problem: we must not write the helper include_partial in the begin of the file "_list.php"
"<? php include_partial ('job / list', array ('jobs' => $ jobs))?>": This line should not exist in the file "_list.php"
Anis3220
Junior Member
 
Posts: 2
Joined: Wed Jul 27, 2011 8:20 pm