Forum

Today's Messages (ON)  | Unanswered Messages (OFF)

Forum: symfony 1.0
 Topic: Validation form on multiple fields
Validation form on multiple fields [message #65694] Fri, 21 November 2008 10:39
undr  is currently offline undr
Messages: 3
Registered: January 2008
Junior Member
Hello,

I use symfony 1.0.18.

I have a form with 4 fields that are not required.

I want to check if all the 4 are not fillin, in this case the form must not pass.

The probelm is that if they are not required, they 're not defined!

I also want to proceed to conditional checks between differents field that may or may not be fillin.


Someone has an idea?

thanks
Forum: Miscellaneous
 Topic: No one is responding
Re: No one is responding [message #65696 is a reply to message #59086 ] Fri, 21 November 2008 10:59
halfer  is currently offline halfer
Messages: 6002
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I've deleted a number of comments on this thread that either didn't make much sense, or were just trivial. If anyone wishes to make substantial and worthwhile comments about the amount of help they get in the community, that's fine (as is all constructive criticism).

Everyone should remember that the community is made up of individuals, and unfortunately we have a lot of users asking questions who never or rarely offer help themselves. We also have people who have been using symfony for years (and so presumably are quite proficient) who have never assisted in the fora. If either of these apply to you, and you'd like to see the amount of community around symfony improve, then get posting Very Happy

Edit: I should stress there is no requirement for symfonians to help each other out, just that mutual assistance is a nice way to stoke your karma!

[Updated on: Fri, 21 November 2008 11:01]

Forum: General discussion
 Topic: Problem in schema.yml: attribute idMethod not working
Re: Problem in schema.yml: attribute idMethod not working [message #65651 is a reply to message #36586 ] Fri, 21 November 2008 00:25
emanuelgreisen  is currently offline emanuelgreisen
Messages: 1
Registered: November 2008
Junior Member
I am also getting this problem on RELEASE_1_1_5.

It does not work even if I empty the database first.

But if I run the data/sql/lib.model.schema.sql script on an empty database it works.... very odd.
 Topic: tutorials?
tutorials? [message #65654] Fri, 21 November 2008 02:33
kingpin393  is currently offline kingpin393
Messages: 10
Registered: October 2008
Location: Ontario
Junior Member
I have gone through the MyFirstProject tutorial but am wondering if there is some more robust tutorials that show more features of symfony out there?

I have gone through the askeet and think it is great (exactly what I would be looking for) but I am using 1.1 so would be looking for current tutorials.

Can anyone point me to any?

Thanks,


-Kevin
 Topic: Autoloading behaves differently in different environments
Re: Autoloading behaves differently in different environments [message #65656 is a reply to message #62755 ] Fri, 21 November 2008 03:33
lkrubner  is currently offline lkrubner
Messages: 106
Registered: July 2008
Senior Member
I agree with daskalou:

Quote:

I also made sure I added "(relatively) mature", because as PHP frameworks go, symfony is (in my opinion) the premier one out there - having its own book and training courses is testament to this. So having such a "core" bug still in the system is quite disappointing.


There is no question that Symfony is the best of the PHP frameworks, which makes it a little heartbreaking that it still has such core bugs, or that people have to resort to such hacks as using include_once in their controllers. Especially now that mod_rails makes it as easy to use Rails as to use PHP, I'm thinking a lot about steering my next major client to Rails, rather than any PHP framework. There is no question that PHP is behind Ruby when it comes to frameworks. The old argument that PHP is easier to use than Ruby is much less true now than it was even 18 months ago.
 Topic: sfPropelForm not populating field values
sfPropelForm not populating field values [message #65655] Fri, 21 November 2008 02:47
RR_QQ2  is currently offline RR_QQ2
Messages: 47
Registered: August 2007
Member
Ok so I follow this tutorial http://www.symfony-project.org/book/forms/1_1/en/04-Propel-I ntegration

and everything gets built successfully. Now I am trying to edit a data object (a row in a table) like so:

$editJobObject = JobPeer::retrieveByPk(666);
$this->form = new JobForm($editJobObject );


with a template like this:


<?php $job = $form->getObject();

//print "<pre>".print_r($form, true)."</pre>";exit;?>
<h1><?php echo $job->isNew() ? 'New' : 'Edit' ?> Job</h1>
 
<form action="" method="post">
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form ?>
    </tbody>
  </table>
</form>


And YES the row with that pk exists and the objects gets populated but still the form values are not populated. Could it be a problem with the sfForms not being generated correctly? Maybe a problem with my model/form classes or maybe the schema?

I never get ANY ANSWERS here recently but since this is SYMFONY forum I hope someone can help out. Lack of any good documentation or examples out there are KILLING me.

[Updated on: Fri, 21 November 2008 02:49]

Re: sfPropelForm not populating field values [message #65657 is a reply to message #65655 ] Fri, 21 November 2008 03:39
lkrubner  is currently offline lkrubner
Messages: 106
Registered: July 2008
Senior Member
Are you sure you're editing the right template? What is the name of the action, and what is the name of the template? If you hit form with print_r at the end of the action, do you get the same thing as if you hit it with print_r at the top of the template? If not, then there must be some other code between the end of the action and the inclusion of the template.

At a guess, I'd look at 3 possibilities:

1.) you're looking at the wrong controller or template

2.) there is code later in your action that overwrites what you've shown us here.

3.) there is more code called elsewhere that for some reason is triggered after the end of your action.

I hope it isn't #3, as that sounds tricky.

 Topic: Help with sfValidatorDoctrineUnique please!
Help with sfValidatorDoctrineUnique please! [message #65664] Fri, 21 November 2008 07:42
MMacLeod  is currently offline MMacLeod
Messages: 18
Registered: April 2008
Junior Member
Hi all, so I'm submitting a form to create a new user and I need the username and email fields to be unique. I read through the documentation and am trying to use sfValidatorDoctrineUnique but cannot get it to work. Here is the code:

<?php

/**
 * User form.
 *
 * @package    form
 * @subpackage User
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class UserForm extends sfForm
{ 
  public function configure()
  { 
		$this->setWidgets(array(
      'username'   => new sfWidgetFormInput(array(), array('class' => 'reg_field', 'maxlength' => 15, 'onchange' => 'validateRegFormInput("username")')),
      'email'      => new sfWidgetFormInput(array(), array('class' => 'reg_field', 'onchange' => 'validateRegFormInput("email")')),
			'email2'     => new sfWidgetFormInput(array(), array('class' => 'reg_field_repeat')),
      'password'   => new sfWidgetFormInput(array(), array('class' => 'reg_field', 'type' => 'password')),
			'password2'  => new sfWidgetFormInput(array(), array('class' => 'reg_field_repeat', 'type' => 'password')),
    ));
		
		$this->setValidators(array(
      'username'   => new sfValidatorString(array('min_length' => 4, 'max_length' => 15)),
      'email'      => new sfValidatorEmail(),
			'email2'     => new sfValidatorEmail(),
      'password'   => new sfValidatorString(array('min_length' => 6, 'max_length' => 20)),
      'password2'  => new sfValidatorString(array('min_length' => 6, 'max_length' => 20)),
    ));
		
		// Check the passwords are the same
		$this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('password', '==', 'password2',
			array(),
			array('invalid' => 'The passwords you entered do not match')));
		
		// Check the passwords are the same
		$this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('email', '==', 'email2',
			array(),
			array('invalid' => 'The emails you entered do not match')));
		
		// Check that the username is unique
		$this->validatorSchema->setPostValidator(
		new sfValidatorDoctrineUnique(array('model' => 'sfGuardUser', 'column' => array('username'))));
	
	        // Check that the email is unique
		$this->validatorSchema->setPostValidator(
		new sfValidatorDoctrineUnique(array('model' => 'Profile', 'column' => array('email'))));
		
		$this->widgetSchema->setNameFormat('user[%s]');
  }
}


I've also tried putting it in the setup() function of the base user form class. Any help is greatly appreciated!

Thanks
 Topic: [sfException] Invalid culture supplied: en-CA
[sfException] Invalid culture supplied: en-CA [message #65665] Fri, 21 November 2008 07:52
rekabis  is currently offline rekabis
Messages: 43
Registered: June 2008
Location: Kelowna, British Columbia...
Member
All I did was restart my server…

I have a Generated admin section, with several administration modules. All work perfectly except for one, which had suddenly come up with this error:

[sfException]
Invalid culture supplied: en-CA


I have checked in my config files (ALL of them), and have found “en-CA” in only TWO places:

settings.yml, bottom of file
    # i18n
    default_culture:        en-CA        # Default user culture


view.yml
    #keywords:     symfony, project
    language:     en-CA
    robots:       noindex, nofollow


These are the only two locations in the entire backend where they appear. Why would the affect one module but none of the others?

Changing “en-CA” to “en” or “en-US” doesn’t fix this problem. Even re-commenting the lines out doesn’t solve things.

How do I fix this?

[Updated on: Fri, 21 November 2008 07:55]

 Topic: Date validation on raw dates.
Re: Date validation on raw dates. [message #65668 is a reply to message #65618 ] Fri, 21 November 2008 08:19
skywalker  is currently offline skywalker
Messages: 132
Registered: March 2008
Location: Norway
Senior Member
The last code looked much more "sexy" compared to the first code Smile


May the source be with you
 Topic: [resolved] Gender dropdown with admingenerator
Re: [resolved] Gender dropdown with admingenerator [message #65692 is a reply to message #5504 ] Fri, 21 November 2008 10:07
shamsh  is currently offline shamsh
Messages: 2
Registered: November 2008
Location: Dhaka
Junior Member
may be this can help you.

http://snipplr.com/view/4057/populate-objectselecttag-with-y our-own-objects-in-symfony/
 Topic: [FIXED in 1.1.5] symfony outputs garbage characters before and after html code
Re: symfony outputs garbage characters before and after html code [message #65698 is a reply to message #63660 ] Fri, 21 November 2008 11:16
xpuc  is currently offline xpuc
Messages: 33
Registered: May 2007
Member
Now that 1.1.5 is released, I upgraded my projects - and really, the problem isn't there any more.

Thanks for fixing this bug!
 Topic: Upload changes FLV extension to EXE
Re: Upload changes FLV extension to EXE [message #65702 is a reply to message #52520 ] Fri, 21 November 2008 11:43
jarod51  is currently offline jarod51
Messages: 69
Registered: May 2006
Member
In SF 1.1 the mime-types.dat is still incomplete

So here is a little "patch" for your upload code

$new_file_name = sha1($item_file->getOriginalName());
$new_file_name .= (in_array($item_file->getOriginalExtension(),array('.flv'))) ? $item_file->getOriginalExtension() : $item_file->getExtension($item_file->getOriginalExtension());


Just insert in the extension array, the extension that you don't want to be renamed to .exe

But there's still the problem of the mime type validation, so it's an half solution Confused

[Updated on: Fri, 21 November 2008 11:43]

Forum: General plug-ins
 Topic: plugins web folder
Re: plugins web folder [message #65683 is a reply to message #57899 ] Fri, 21 November 2008 09:33
Notorious  is currently offline Notorious
Messages: 139
Registered: March 2007
Senior Member
Might be something with this section in the package.xml:
71 	     <dir name="web">
72 	       <dir name="css">
73 	         <file name="media.css" role="data"/>
74 	       </dir>
75 	       <dir name="images">
76 	         <file name="archive.png" role="data"/>
77 	         <file name="bin.png" role="data"/>
78 	         <file name="delete.png" role="data"/>
79 	         <file name="doc.png" role="data"/>
80 	         <file name="edit.png" role="data"/>
81 	         <file name="filenew.png" role="data"/>
82 	         <file name="folder.png" role="data"/>
83 	         <file name="folder_new.png" role="data"/>
84 	         <file name="folder_open.png" role="data"/>
85 	         <file name="html.png" role="data"/>
86 	         <file name="image.png" role="data"/>
87 	         <file name="pdf.png" role="data"/>
88 	         <file name="ppt.png" role="data"/>
89 	         <file name="txt.png" role="data"/>
90 	         <file name="unknown.png" role="data"/>
91 	         <file name="up.png" role="data"/>
92 	         <file name="xls.png" role="data"/>
93 	       </dir>
94 	       <dir name="js">
95 	         <file name="main.js" role="data"/>
96 	       </dir>
97 	     </dir>
 Topic: Admin Generator select_tag - Selected
Admin Generator select_tag - Selected [message #65685] Fri, 21 November 2008 09:44
adamli  is currently offline adamli
Messages: 47
Registered: July 2008
Location: Germany
Member
Hallo
How can I in admin generator set default value for select_tag ?

HTML:
<SELECT NAME=\"year\">
 <OPTION SELECTED=\"SELECTED\">$xyz    
 <OPTION>1978<OPTION>1979<OPTION>1980<OPTION>1981
 <OPTION>1982<OPTION>1983<OPTION>1984<OPTION>1985
</SELECT>


<OPTION SELECTED=\"SELECTED\">$xyz


Many thanks
 Topic: sfSmartyPlugin official thread
Re: sfSmartyPlugin official thread [message #65701 is a reply to message #65460 ] Fri, 21 November 2008 11:30
insaini  is currently offline insaini
Messages: 21
Registered: August 2008
Location: Brampton, ON
Junior Member
Hey thats great to hear. I havent had time to work on this for a while.. but I will try to look into this problem by the end of the weekend. If you try hacking away at it and find a solution let me know I can update the code.


One thing that is still missing is the MailView as well..

Jesse
 Topic: access to web folder of plugin
access to web folder of plugin [message #65689] Fri, 21 November 2008 09:51
Notorious  is currently offline Notorious
Messages: 139
Registered: March 2007
Senior Member
I am looking for a way to avoid copying of files in the plugin web folder to the application web folder.

I was looking through sfSimpleForumPlugin to see how get access to the images. But I'm not getting it.

In a module there is a helper call to
image_tag('/sfSimpleForumPlugin/images/feed-icon.png', 'align=top')

but the feed-icon file is in location
<plugin>/web/images/feed-icon.png


Do these files get copied to the apps webdir somehow in a submap for the plugin?

The view.yml also refers to
stylesheets: [/sfSimpleForumPlugin/css/default.css]
So I get the feeling that files are being copied somehow?
Re: access to web folder of plugin [message #65703 is a reply to message #65689 ] Fri, 21 November 2008 12:41
whalexis  is currently offline whalexis
Messages: 107
Registered: July 2008
Location: Montréal, Québec, Canad...
Senior Member
Hi,

It depends on the OS you use.
If you're using any flavor of Unices, those files won't be copied just linked. As Windows doesn't support links, those files are copied to the same place the link is created.

So if you don't want files to be copied, switch your OS.

Alexis
Forum: Installation and setup
 Topic: error in propel-build-sql
Re: error in propel-build-sql [message #65667 is a reply to message #65616 ] Fri, 21 November 2008 08:18
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
try to solv this for me!!!!!!!!!!!!!1


give the best
Re: error in propel-build-sql [message #65670 is a reply to message #65667 ] Fri, 21 November 2008 08:22
skywalker  is currently offline skywalker
Messages: 132
Registered: March 2008
Location: Norway
Senior Member
Take a look at http://propel.phpdb.org/trac/wiki/Users/Documentation/1.3/Co lumnTypes

TEXT is not supported. Use LONGVARCHAR.


May the source be with you
Re: error in propel-build-sql [message #65680 is a reply to message #65670 ] Fri, 21 November 2008 09:06
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
sir i checked and change LONGVARCHAR to TEXT and vice versa but thats also not working........any other idea or more detail with the same suggestion.

[Updated on: Fri, 21 November 2008 09:12]


give the best
Re: error in propel-build-sql [message #65681 is a reply to message #65680 ] Fri, 21 November 2008 09:10
skywalker  is currently offline skywalker
Messages: 132
Registered: March 2008
Location: Norway
Senior Member
What is the exact error messages? And how does the schema.yml looks like?


May the source be with you
Re: error in propel-build-sql [message #65682 is a reply to message #65681 ] Fri, 21 November 2008 09:21
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
this is my schema.yml
and i run command 'symfony propel-build-sql'

and the error is

Error setting up column 'direction': Cannot map unknown Propel type 'TYPE:LONGVARCHAR' to native database type.

propel:
_attributes:
package: lib.model
defaultIdMethod: none
noXsd: false
inquiry:
id:
type: INTEGER
required: true
primaryKey: true
listing_id:
type: INTEGER
foreignTable: listing
foreignReference: id
onDelete: RESTRICT
onUpdate: RESTRICT
to_member_id:
type: INTEGER
foreignTable: member
foreignReference: id
onDelete: RESTRICT
onUpdate: RESTRICT
from_member_id:
type: INTEGER
foreignTable: member
foreignReference: id
onDelete: RESTRICT
onUpdate: RESTRICT
date:
type: DATE
message:
type: LONGVARCHAR
_indexes:
listing_id:
- listing_id
to_member_id:
- to_member_id
from_member_id:
- from_member_id

[Updated on: Fri, 21 November 2008 09:22]


give the best
Re: error in propel-build-sql [message #65687 is a reply to message #65682 ] Fri, 21 November 2008 09:48
skywalker  is currently offline skywalker
Messages: 132
Registered: March 2008
Location: Norway
Senior Member
jyoti.coderevolts wrote on Fri, 21 November 2008 09:21

this is my schema.yml
and i run command 'symfony propel-build-sql'

and the error is

Error setting up column 'direction': Cannot map unknown Propel type 'TYPE:LONGVARCHAR' to native database type.



I got a schema that does use LONGVARCHAR, but we have only used the command 'symfony propel-build-model' (since the database is an old one).

Does a build model work?


May the source be with you
Re: error in propel-build-sql [message #65688 is a reply to message #65616 ] Fri, 21 November 2008 09:49
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
sorry i should give u the attachment :?

  • Attachment: schema.yml
    (Size: 0.79KB, Downloaded 2 time(s))


give the best
Re: error in propel-build-sql [message #65690 is a reply to message #65687 ] Fri, 21 November 2008 09:52
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
yes sir that command working means,it built a db in my phpmyadmin


give the best
Re: error in propel-build-sql [message #65693 is a reply to message #65690 ] Fri, 21 November 2008 10:39
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
sir what happened it'll work or not


give the best
 Topic: Where are the log files created in production environment?
Re: Where are the log files created in production environment? [message #65699 is a reply to message #65355 ] Fri, 21 November 2008 11:16
sandydessert  is currently offline sandydessert
Messages: 46
Registered: August 2008
Member
Nobody there??

I want am not able to create log files in production environment. I have set logging_enabled option to on. Then cleared cache but log files are not getting created.
 Topic: Problem of registered handler
Problem of registered handler [message #65709] Fri, 21 November 2008 13:55
regis  is currently offline regis
Messages: 6
Registered: November 2008
Junior Member
Hi !!!

I have a new problem, when i want to clear my cache i have this error. I'm working with a sandbox and i would prefer to keep it instead of installing a synfony version.

Thanks for help.

here is my code:

C:\Program Files\EasyPHP 2.0b1\www\SYTGEMweb>
php -c "C:\Program Files\EasyPHP 2.
0b1\apache" symfony cc
>> cache Clearing cache type "all" for "frontend" app and "prod" env


Configuration file "C:\Program Files\EasyPHP 2.0b1\www\SYTGEMweb\lib\symfony/c
onfig/config/settings.yml, C:\Program Files\EasyPHP 2.0b1\www\SYTGEMweb\apps\fro
ntend/config/settings.yml" does not have a registered handler.

 Topic: 1.2 PEAR install -> failed to open stream: Permission denied
1.2 PEAR install -> failed to open stream: Permission denied [message #65704] Fri, 21 November 2008 12:43
ventzy  is currently offline ventzy
Messages: 7
Registered: June 2008
Junior Member
on Vista, running command prompt as administrator

C:\root\apache>pear -V
PEAR Version: 1.7.2
PHP Version: 5.2.6

C:\root\apache>pear install symfony/symfony-1.2.0BETA2
downloading symfony-1.2.0BETA2.tgz ...
Starting to download symfony-1.2.0BETA2.tgz (2,658,354 bytes)
............................................................ ....................
............................................................ ....................
............................................................ ....................
............................................................ ....................
............................................................ ....................
.............done: 2,658,354 bytes
ERROR: failed to write C:\root\apache\PEAR\symfony\plugins\sfPropelPlugin\lib\vendo r\propel-generator\bin\.tmppropel-gen.bat: copy(C:\root\apache\PEAR\symfony\plugins\sfPropelPlugin\lib\ vendor\propel-generator\bin\.tmppropel-gen.bat): failed to open stream: Permission denied

[Updated on: Fri, 21 November 2008 13:11]

Re: 1.2 PEAR install -> failed to open stream: Permission denied [message #65710 is a reply to message #65704 ] Fri, 21 November 2008 14:02
ventzy  is currently offline ventzy
Messages: 7
Registered: June 2008
Junior Member
OK, that was firewall issue.

I reinstalled pear, then on "pear install symfony/symfony-1.2.0BETA2" command, my firewall ask me for permission PHP to create folders/files. The previous time it doesnt ask me nothing, so I suppose that the permission was denied silently.
Forum: symfony 1.1
 Topic: Problem with plugin installation
Problem with plugin installation [message #65659] Fri, 21 November 2008 06:04
hpharipriya  is currently offline hpharipriya
Messages: 7
Registered: November 2008
Junior Member
Hello,

I am trying to install the plugin
xsPasswordManagerPlugin, to my application.

But when I run this command
symfony plugin-install http://plugins.symfony-project.com/sfPasswordStrengthPlugin
I am getting some errors and warnings like this:

installing plugin "http://plugi...t.com/sfPasswordStrengthPlugin"
PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/DependencyDB.php on line 398
PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/DependencyDB.php on line 398
PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/DependencyDB.php on line 398
PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/DependencyDB.php on line 398
PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/DependencyDB.php on line 398
PHP Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/DependencyDB.php on line 398
PHP Notice: Array to string conversion in /usr/share/pear/PEAR/Registry.php on line 456
PHP Fatal error: Call to a member function setConfig() on a non-object in /usr/share/pear/PEAR/DependencyDB.php on line 533



Also I am getting the same error and warnings when i tried to in stall sfGuardPlugin
with this command:
symfony plugin:install sfGuardPlugin


Please help me with this...

Haripriya S.

[Updated on: Fri, 21 November 2008 06:09]

 Topic: plugin Installation problem
Re: plugin Installation problem [message #65662 is a reply to message #65574 ] Fri, 21 November 2008 07:08
jyoti.coderevolts  is currently offline jyoti.coderevolts
Messages: 11
Registered: November 2008
Junior Member
sir/mam i run command
"symfony plugin:install sfBreadNavPlugin --release=1.1.1"
and got the error you have seen :(


and i was just trying to use the plugin so i got this from 'plugin'link in this forum itself....... :)

[Updated on: Fri, 21 November 2008 07:11]


give the best
 Topic: My first symfony project tutorial - post/show redirect error
Re: My first symfony project tutorial - post/show redirect error [message #65653 is a reply to message #65632 ] Fri, 21 November 2008 02:18
shaunole  is currently offline shaunole
Messages: 2
Registered: November 2008
Junior Member
The latest post seemed to resolve the issue on my end. Here's the final fix:

in sf_sandbox/apps/frontend/modules/comment/actions/actions.cla ss.php My edit and show functions look like this:

  public function executeEdit($request)
  {
    $this->form = new BlogCommentForm(BlogCommentPeer::retrieveByPk($request->getParameter('id')));
$this->form->setDefault('blog_post_id', $request->getParameter('post_id'));
  }

  public function executeUpdate($request)
  {
    $this->forward404Unless($request->isMethod('post'));

    $this->form = new BlogCommentForm(BlogCommentPeer::retrieveByPk($request->getParameter('id')));

    $this->form->bind($request->getParameter('blog_comment'));
    if ($this->form->isValid())
    {
      $blog_comment = $this->form->save();

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

    $this->setTemplate('edit');
  }


I could be wrong, but i never saw the instruction to add the following in the tutorial (to executeEdit):
$this->form->setDefault('blog_post_id', $request->getParameter('post_id'));


The executeEdit instruction in that tutotial instructs you to make changes that should be made within the executeUpdate function (from what I understand). I hope this is helpful, and thanks for all the toubleshooting guys!!

[Updated on: Fri, 21 November 2008 02:18]

Re: My first symfony project tutorial - post/show redirect error [message #65660 is a reply to message #65538 ] Fri, 21 November 2008 06:26
Seikilos  is currently offline Seikilos
Messages: 110
Registered: May 2008
Location: Germany
Senior Member
If you finally solved the problem and it is a bug in the documentation then please do a quick registration on symfony's ticket system and post this as a documentation ticket to be fixed to clean the path for other newbies trying to dive into symfony
(http://www.symfony-project.org/user/new)


Debugging is all I doֻ
Re: My first symfony project tutorial - post/show redirect error [message #65666 is a reply to message #65538 ] Fri, 21 November 2008 08:09
_Oli_  is currently offline _Oli_
Messages: 4
Registered: November 2008
Junior Member
Ok, i will do it this morning when i'll be back in my office.

For Adass007 : I have the same code than shaunole in the sf_sandbox/apps/frontend/modules/comment/actions/actions.cla ss.php file.

[Updated on: Fri, 21 November 2008 08:47]

 Topic: how do I access module.yml
Re: how do I access module.yml [message #65652 is a reply to message #65649 ] Fri, 21 November 2008 01:02
GaryFx
Messages: 248
Registered: May 2008
Location: Masschusetts
Faithful Member
Assuming that the name of your module is 'module', then the name you need to get is 'mod_module_default_user_name'. After all, there needs to be some way for sfConfig::get to know which module you're referring to.

Re: how do I access module.yml [message #65661 is a reply to message #65652 ] Fri, 21 November 2008 06:59
payacer  is currently offline payacer
Messages: 21
Registered: July 2008
Location: Canada
Junior Member
thanks...

sorry couldn't find that info....btw do you recommend using the module.yml for globals if I only need the variables in one module?...or should I just throw them in the general config folder?...does it make a difference in loading?

Andrew
Re: how do I access module.yml [message #65671 is a reply to message #65649 ] Fri, 21 November 2008 08:27
Seikilos  is currently offline Seikilos
Messages: 110
Registered: May 2008
Location: Germany
Senior Member
No, I thing putting it into module.yml if it is for one module is the right place.

Did you tried to remove the underscores for the field name?

Try defaultuser not default_user since the underscore in the sfconfig is used to derive the next level it may cause problems.

According to doc, putting it into app would result in app_defaultuser_name
So try sth like
yourmodulename_defaultuser_name


Debugging is all I doֻ
 Topic: IE6 and login system
Re: IE6 and login system [message #65663 is a reply to message #65555 ] Fri, 21 November 2008 07:25
someone1  is currently offline someone1
Messages: 14
Registered: August 2008
Location: New Jersey
Junior Member
I'm pretty sure IE6 does save session cookies, this is seen by the fact that my credentials i set are being seen in the loaded session data (I look at the session data using a separate script i wrote, so its not like symfony is rewriting it). Its just that the data in the session is blank, none of the array keys have any values set except for other arrays as needed.

thanks for the idea though, i tried it anyway and no success :/
Pages (2): [1  2  >  »]

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software