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

[My first symfony project] Problems

Other symfony projects

[My first symfony project] Problems

by jeanmich » Thu Nov 06, 2008 10:42 pm

Hello,
I follow the tutorial called "My first symfony project" because I want to work with this framework, but I got problems/remarks about the tutorial.

1) Initialize the data model.
Code: Select all
propel:
  blog_post:
    id:           ~
    title:        { varchar(255), required: true }
    excerpt:      longvarchar
    body:         longvarchar


It is not varchar(255) but
Code: Select all
title:        { type: varchar(255), required: true }


2)a) Add a record relative to another table
Code: Select all
Next, after adding a comment, we want the user to come back to the post it relates to, rather that remaining on the comment editing page. To accomplish this, we need to edit executeEdit method. Find the following code in sf_sandbox/apps/frontend/modules/post/actions/actions.class.php:

if ($request->isMethod('post'))
{
  $this->form->bind($request->getParameter('blog_comment'));
  if ($this->form->isValid())
  {
    $blog_comment = $this->form->save();
 
    $this->redirect('comment/edit?id='.$blog_comment->getId());
  }
}
 

And change the redirect line so it reads thus:

$this->redirect('post/show?id='.$blog_comment->getBlogPostId());


In fact, it is comment/actions/actions.class.php file and not post/actions/actions.class.php file.

b) When I wrote that code and I want to add a comment by clicking in a post, it doesn't associate the comment to the post. What is wrong in the code? I don't know what's wrong.

3) In file /sf_sandbox/apps/frontend/modules/comment/actions/actions.cl ass.php, there is:
Code: Select all
this->redirect('post/show?id='.$blog_comment->getBlogPostId());


But when I edit a comment and I valide it, I got a 404 error post/show doesn't exist...

4) And finally when I finish the project, I have links "list of posts" and "list of comments" but I got again "web/latest_posts was not found on this server." Why? Where do we have to write the link in this project?


I have write the project entirely and verify all of lines and everything is like the tutorial.
Thank you for your help if something's wrong with the tutorial.
jeanmich
Junior Member
 
Posts: 24
Joined: Thu Nov 06, 2008 10:31 pm
Location: France

Re: [My first symfony project] Problems

by R3v3ng3 » Sat Nov 08, 2008 12:37 pm

I had the same problem, it's the tutorial fault, you can read more about it http://www.symfony-project.org/forum/index.php/m/64798/#msg_ 64798. On the bottom of the page you'll find the solution.
R3v3ng3
Junior Member
 
Posts: 2
Joined: Sat Nov 08, 2008 3:15 am

Re: [My first symfony project] Problems

by jeanmich » Sat Nov 08, 2008 5:09 pm

Thank you for the link, so I'll try to correct project.
jeanmich
Junior Member
 
Posts: 24
Joined: Thu Nov 06, 2008 10:31 pm
Location: France

Re: [My first symfony project] Problems

by halfer » Sun Nov 09, 2008 12:38 am

Sorry for any problems. I wrote the original version for 1.1, and a modified version, but version three (which is live now) seems to have some problems in it. It contains changes to my code/text from someone else, and I think unfortunately it may not have actually been tested.

I have therefore dropped the url of a working zip-file, should anyone be interested, in the above-mentioned thread. I guess this is not an 'official' tarball, but it works :D~ :-D~ :grin:
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: [My first symfony project] Problems

by nullspace » Tue Nov 11, 2008 5:39 pm

I have the same issues as number 2 and 3

It appears that the blog_post_id is not being pushed to the comments page in such a way the comments page is expecting. It looks as id the blog_post_id is posted to the url and the logic is expecting the value to reside in the hidden value. I don't know of a fix for this that isn't a hack since I just started symfony myself and these bugs are really making this framework hard understand. I kinda need my hand held for this one bug as I get use to the different functions in the framework and what they do.

P.S. something funky happened to the forum post as the page doesn't seem to wrap lines.
nullspace
Junior Member
 
Posts: 4
Joined: Fri Nov 07, 2008 9:45 pm

Re: [My first symfony project] Problems

by Primavera888 » Mon Nov 04, 2013 12:21 pm

i also had problems with tutorial
Primavera888
Junior Member
 
Posts: 3
Joined: Mon Nov 04, 2013 12:06 pm