| Forum: symfony 1.2 |
|---|
| Topic: doctrine:insert-sql does not create tables |
|---|
| Re: doctrine:insert-sql does not create tables [message #65658 is a reply to message #65643 ] |
Fri, 21 November 2008 06:00 |
bluefossil Messages: 14 Registered: January 2006 |
Junior Member |
|
|
Positive. I have two *schema.yml files in config/doctrine. The model files and schema.sql can all be generated, just that the db tables cannot be created with doctrine:insert-sql.
Anyway, I tried again, this time using doctrine:rebuild-db and doctrine:build-all-reload and it works! I'm still not sure why doctrine:insert-sql doesn't work, but I guess rebuild and reload works for me for now.
Thanks!
Regards,
Ron
|
|
|
| Topic: i18n propel:build-schema symfony 1.2 |
|---|
| Re: i18n propel:build-schema symfony 1.2 [message #65675 is a reply to message #65642 ] |
Fri, 21 November 2008 08:36 |
bullwinkle Messages: 39 Registered: April 2006 |
Member |
|
|
| bidule wrote on Thu, 20 November 2008 13:59 | I had the same problem. I actually replaced the declarations by ~, instead of commenting/removing the lines.
|
Nice tip.
| Quote: | This looks like a bug candidate, unless build-schema gets deprecated in this version.
|
Now I am worried. Why would build-schema be deprecated?
|
|
|
| Topic: 1:1 Relations with embedForm in Propel? |
|---|
| 1:1 Relations with embedForm in Propel? [message #65686] |
Fri, 21 November 2008 09:48 |
bouke Messages: 2 Registered: November 2008 |
Junior Member |
|
|
Hi there!
I'm trying to get embedded forms to work with a 1:1 relation. I have the following model in /config/schema.yml
[yml]
propel:
task:
id: ~
started_at: timestamp
duration: { type: integer }
car_usage_id: { type: integer, foreignReference: id, foreignTable: car_usage }
car_usage:
id: ~
task_id: { type: integer, foreignReference: id, foreignTable: task }
mileage_start: { type: integer }
mileage_end: { type: integer }
Then I embed the form in /lib/form/TaskForm.php:
<?php class TaskForm extends BaseTaskForm
{
public function configure()
{
$carForm = new CarUsageForm();
unset($carForm['task_id']);
$this->embedForm('car_usage_id', $carForm);
}
} ?>
Then using propel:generate-admin backend Task I get the admin interface. The form displays correctly as expected:

But then - o horror - the problems arise. When trying to save this form I get the following error:
Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1452 Cannot add or update a child row: a foreign key constraint fails (`sf_test/task`, CONSTRAINT `task_FK_2` FOREIGN KEY (`car_usage_id`) REFERENCES `car_usage` (`id`))]
I also tried dropping the car_usage_id from the Task, but then the following error is thrown:
Unable to execute INSERT statement. [wrapped: SQLSTATE[HY000]: General error: 1364 Field 'task_id' doesn't have a default value]
So what's going wrong; I would really like to use the enhanced embedded forms!
|
|
|
| Forum: symfony 1.0 |
|---|
| Topic: Validation form on multiple fields |
|---|
| Validation form on multiple fields [message #65694] |
Fri, 21 November 2008 10:39 |
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 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 
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 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 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 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 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 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 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 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 Messages: 132 Registered: March 2008 Location: Norway |
Senior Member |
|
|
The last code looked much more "sexy" compared to the first code
May the source be with you
|
|
|
| Topic: [resolved] Gender dropdown with admingenerator |
|---|
|
| 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 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 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
[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 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 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 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 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 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 Messages: 11 Registered: November 2008 |
Junior Member |
|
|
try to solv this for me!!!!!!!!!!!!!1
give the best
|
|
|
|
| Re: error in propel-build-sql [message #65680 is a reply to message #65670 ] |
Fri, 21 November 2008 09:06 |
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 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 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 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 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 Messages: 11 Registered: November 2008 |
Junior Member |
|
|
yes sir that command working means,it built a db in my phpmyadmin
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 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: 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 Messages: 6 Registered: June 2008 |
Junior Member |
|
|
on Vista, running command prompt as administrator
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 12:44]
|
|
|
| Forum: symfony 1.1 |
|---|
| Topic: Problem with plugin installation |
|---|
| Problem with plugin installation [message #65659] |
Fri, 21 November 2008 06:04 |
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 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 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 Messages: 108 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_ 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 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 Messages: 108 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ֻ
|
|
|