[symfony-users] SOAP
I found this presentation http://2010.rmll.info/SOAP-and-RESTful-webservices-with-Symfony.html?lang=fr for SOAP and Symfony.. and.. I don't speak french but the code seems pretty interesting. Anyone has a similar presentation or url, but in english? Thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] How to style embedded forms
Can someone point me on how to style embedded forms? I am able to embed a form, but now it looks completely as part of my main form. In reality I want them to look like 2 sections, with one submit, but i want to style the bottom part a bit differently.. being on a separate box than the main form, etc... Any help? Thank you. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] csrf token required
Hi, I am getting a Csrf Token required error, but not sure why. This is a very simple form, made the same way I've made many other forms but never got this error before. What should I be checking for? Thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Mandatory fields created_at
Hi, I created a simple new Table in my schema, and selected it as timestampable, then generated the CRUD.. but for some reason is setting the created at and updated at fields as mandatory, and not really just using default values... what am i doing wrong and why do i need to enter this fields? thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Preventing users from seeing others information
Thanks for the replies. Slugs would work for the profile and certain areas and just simply /profile would also work for the profile, but for example, I have a "Subscribers" addressbook, where the only required field is their mobile number, then something like mysite/subscribers/301212<-- nothing stops another user from typing random numbers to see if they exist Is there a generic way to avoid this? I guess using GET? but i am not sure. On Mon, May 24, 2010 at 10:59 PM, Eno wrote: > On Mon, 24 May 2010, Samuel Morhaim wrote: > > > mysite.com/account/profile/5 > > > > What prevents me from switching the /5 for a /4 /3 .. etc.. to call the > > profile for other Id's? How do you prevent this from happening? > > You should never use real database IDs, use slugs: > > http://www.symfony-project.org/gentle-introduction/1_4/en/09-Links-and-the-Routing-System > > > > -- > A > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Preventing users from seeing others information
If I have something such as mysite.com/account/profile/5 What prevents me from switching the /5 for a /4 /3 .. etc.. to call the profile for other Id's? How do you prevent this from happening? thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Headers already sent
I am trying to move my site from one host to another... same code on both.. however on the new server, one of my modules is throwing this *Warning*: Cannot modify header information - headers already sent by (output started at /var/www/ zizzerdog.com/httpdocs/apps/backend/modules/message/actions/actions.class.php:1) in */usr/share/php/PEAR/symfony-1.4.4/lib/response/sfWebResponse.class.php*on line *336* *Warning*: Cannot modify header information - headers already sent by (output started at /var/www/ zizzerdog.com/httpdocs/apps/backend/modules/message/actions/actions.class.php:1) in */usr/share/php/PEAR/symfony-1.4.4/lib/response/sfWebResponse.class.php*on line *357 Any ideas on how to fix this? Its exactly the same code which is working fine on the other host.. * -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Doctrine Migration
I did remove the idx.. but still get the same error. Thank you anyway.. any other suggestions please? 2010/5/11 Michał Piotrowski > Hi, > > 2010/5/11 Samuel Morhaim : > > Hi, > > > > When attempting to do a migration I get the error below. Reading about, > it > > mentions that I am probably missing an index for the key, but I already > > added it. I also made sure that both the local and foreign key are the > same > > type, cleared cache, etc. Please help as I need to do this migration. > > > > > >- SQLSTATE[HY000]: General error: 1005 Can't create table > > './zd2/#sql-605_46046.frm' (errno: 150). Failing Query: "ALTER TABLE > > message_queue ADD CONSTRAINT message_queue_campaign_id_campaign_id > FOREIGN > > KEY (campaign_id) REFERENCES campaign(id)" > > > > > > > > Doing a "show innodb status;" I get the following message but it doesnt > make > > sense, since the key is already there and confirmed by the error i get > when > > i attempt the migration for a second time. > > > > 100510 18:30:08 Error in foreign key constraint of table > zd2/#sql-605_45ffb: > > FOREIGN KEY (campaign_id) REFERENCES campaign(id): > > Cannot find an index in the referenced table where the > > referenced columns appear as the first columns, or column types > > in the table and the referenced table do not match for constraint. > > > > > >- SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate > key > > name 'campaign_id_idx_idx'. Failing Query: "CREATE INDEX > campaign_id_idx_idx > > ON message_queue (campaign_id)" > > > > > > > > > > == > > up part of migration (down ommited for the email) > > > > $this->addIndex('message_queue', 'campaign_id_idx', array( > > I think that I know this bug, you need to change this to campaign_id > > Regards, > Michal > > > 'fields' => array( > > 'campaign_id' => array() > > ) > > )); > > > > > > $this->createForeignKey('message_queue', > > 'message_queue_campaign_id_campaign_id', array( > > 'local' => 'campaign_id', > > 'foreign' => 'id', > >'foreignTable' => 'campaign' > > )); > > > > > > > > > > > > Schema > > > > MessageQueue: > > actAs: { Timestampable: ~ } > > columns: > > id:{ primary: true, unique: true, type: integer > > ,notnull: true, autoincrement: true } > > subscriber_id: { type: integer, notnull: false } > > campaign_id: { type: integer, notnull: false } > > schedule_at: { type: timestamp, notnull: true } > > msg_contents: { type: string(255), notnull: true } > > status:{ type: enum, values: > > [Pending,Delivered,Canceled,Failed], notnull: true } > > relations: > > Campaign: > > local: campaign_id > > foreign: id > > > > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/symfony-users?hl=en > > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Doctrine Migration
Hi, When attempting to do a migration I get the error below. Reading about, it mentions that I am probably missing an index for the key, but I already added it. I also made sure that both the local and foreign key are the same type, cleared cache, etc. Please help as I need to do this migration. - SQLSTATE[HY000]: General error: 1005 Can't create table './zd2/#sql-605_46046.frm' (errno: 150). Failing Query: "ALTER TABLE message_queue ADD CONSTRAINT message_queue_campaign_id_campaign_id FOREIGN KEY (campaign_id) REFERENCES campaign(id)" Doing a "show innodb status;" I get the following message but it doesnt make sense, since the key is already there and confirmed by the error i get when i attempt the migration for a second time. 100510 18:30:08 Error in foreign key constraint of table zd2/#sql-605_45ffb: FOREIGN KEY (campaign_id) REFERENCES campaign(id): Cannot find an index in the referenced table where the referenced columns appear as the first columns, or column types in the table and the referenced table do not match for constraint. - SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'campaign_id_idx_idx'. Failing Query: "CREATE INDEX campaign_id_idx_idx ON message_queue (campaign_id)" == up part of migration (down ommited for the email) $this->addIndex('message_queue', 'campaign_id_idx', array( 'fields' => array( 'campaign_id' => array() ) )); $this->createForeignKey('message_queue', 'message_queue_campaign_id_campaign_id', array( 'local' => 'campaign_id', 'foreign' => 'id', 'foreignTable' => 'campaign' )); Schema MessageQueue: actAs: { Timestampable: ~ } columns: id:{ primary: true, unique: true, type: integer ,notnull: true, autoincrement: true } subscriber_id: { type: integer, notnull: false } campaign_id: { type: integer, notnull: false } schedule_at: { type: timestamp, notnull: true } msg_contents: { type: string(255), notnull: true } status:{ type: enum, values: [Pending,Delivered,Canceled,Failed], notnull: true } relations: Campaign: local: campaign_id foreign: id -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] hl7
Is anyone in the group familiar with Hl7 formats? I am looking to hire a developer for a small project. Thank you. (sorry is this out of topic..) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe, reply using "remove me" as the subject.
Re: [symfony-users] Doctrine dump and then import failing
Ok, here is a simplified form of the error... There is no reason fo this to fail the way its failing.. Schema: Mkq: columns: id:{ primary: true, unique: true, type: integer, notnull: true, autoincrement: true } organization_id: { type: integer } mkqz: { type: string(8), unique: true, notnull: true } relations: Organization: foreign: id local: organization_id type: many Organization: columns: id:{ primary: true, unique: true, type: integer, notnull: true, autoincrement: true } name: { unique: true, type: string(255), notnull: true } Fixture: Organization: Organization_1: name: ZizzerDog Mkq: mk_x: mkqz: myass Organization: Organization_1 Giving error Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references. when doing data load. 2010/4/8 Michał Piotrowski > 2010/4/9 Samuel Morhaim : > > Michael, > > > > first of all, thank you for all the replies. > > > > I already tried that.. it still fails. I moved keywords to be the last > in > > the fixture, but it still fails. I also separated the fixtures into > > 001_data.yml and 002_keywords.yml and it also fails. > > > > Any other suggestions you can think of ? > > Don't know. If the problem is caused only by relation type > > Keyword: > columns: > [..] > relations: >Organization: > local: organization_id > foreign: id > type: many > > Campaign: > columns: > [..] > relations: >Organization: > local: organization_id > foreign: id > > I think that you need to ask doctrine folks or on symfony-dev. If > doctrine don't know how to load it's own data it might be a serious > problem with doctrine. > > Regards, > Michal > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe, reply using "remove me" as the subject.
Re: [symfony-users] Doctrine dump and then import failing
Michael, first of all, thank you for all the replies. I already tried that.. it still fails. I moved keywords to be the last in the fixture, but it still fails. I also separated the fixtures into 001_data.yml and 002_keywords.yml and it also fails. Any other suggestions you can think of ? 2010/4/8 Michał Piotrowski > 2010/4/9 Samuel Morhaim : > > Yes, exactly, however, either by dumping it, or by writing it myself, its > > still not allowing me to load that fixture... the only problem area is > the > > Keyword table, but it doesn't make sense > > > > This should work both ways.. but its not, so what exactly is it causing > that > > error? > > > > Doesnt work: > > Keyword: > > Keyword_1: > > Organization: Organization_2 > > keyword: KW1 > > > > Works but it is not the right way to do it. : > > Keyword: > > Keyword_1: > > organization_id: 2 > > keyword: KW1 > > I think that it's caused by wrong order in data loading. > > Organization_2 is loaded after first use as I see. > > This is why I break data into numbered fixtures - something like > > 001_base_accounts > 100_profiles > 120_threads > and so on. > > The point is to first load data that you use as foreign key in other data. > > > > > > > > 2010/4/8 Michał Piotrowski > >> > >> 2010/4/9 Samuel Morhaim : > >> > Thank you Michal, > >> > > >> > But at this stage, I am just developing, the data is erasable, so I am > >> > not > >> > doing migrations yet. > >> > >> Ah, I understand. > >> > >> > > >> > The process of create->dump->reload process should work.. no? > >> > >> When you are developing it's easier to use a good fixtures then > >> migrating databases schemas > >> > >> -- > >> If you want to report a vulnerability issue on symfony, please send it > to > >> security at symfony-project.com > >> > >> You received this message because you are subscribed to the Google > >> Groups "symfony users" group. > >> To post to this group, send email to symfony-users@googlegroups.com > >> To unsubscribe from this group, send email to > >> symfony-users+unsubscr...@googlegroups.com > >> For more options, visit this group at > >> http://groups.google.com/group/symfony-users?hl=en > > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/symfony-users?hl=en > > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Doctrine dump and then import failing
Yes, exactly, however, either by dumping it, or by writing it myself, its still not allowing me to load that fixture... the only problem area is the Keyword table, but it doesn't make sense This should work both ways.. but its not, so what exactly is it causing that error? Doesnt work: Keyword: Keyword_1: Organization: Organization_2 keyword: KW1 Works but it is not the right way to do it. : Keyword: Keyword_1: organization_id: 2 keyword: KW1 2010/4/8 Michał Piotrowski > 2010/4/9 Samuel Morhaim : > > Thank you Michal, > > > > But at this stage, I am just developing, the data is erasable, so I am > not > > doing migrations yet. > > Ah, I understand. > > > > > The process of create->dump->reload process should work.. no? > > When you are developing it's easier to use a good fixtures then > migrating databases schemas > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Doctrine dump and then import failing
Thank you Michal, But at this stage, I am just developing, the data is erasable, so I am not doing migrations yet. The process of create->dump->reload process should work.. no? 2010/4/8 Michał Piotrowski > Hi, > > 2010/4/9 Samuel Morhaim : > > Hi, > > > > I have a big schema, and I needed to add a new Table, so I did, while I > am > > testing, I dumped my DB to a fixture and it works well, but when I try to > > load it back, it gives me this error: > > > > Couldn't call Doctrine_Core::set(), second argument should be an > instance > > of Doctrine_Collection when setting one-to-many references. > > > > Going back to the data.yml I delete the newly created record and try > > importing, and it works. > > > > I've isolated the problem to this: > > > > The original dump that doesnt work looks like this: > > Keyword: > > Keyword_1: > > Organization: Organization_2 > > keyword: KW1 > > > > However if I change it to the following, it works: > > Keyword: > > Keyword_1: > > organization_id: 2 > > keyword: KW1 > > > > But, this doesn't make sense.. the way doctrine exported it..should > work.. > > not only that.. I have other places in the dump where it works fine: > > Campaign: > > Campaign_1: > > Organization: Organization_2 > > name: 'Special Sale' > > description: 'Special Sale Offer' > > > > > > So, why is this not working? please help. > > You may want to read about doctrine migrations. > > You need to dump actual database, setup migrations on previous scheme, > restore data. After that you just use doctrine:migrate. > > Regards, > Michal > > > > > Schema: http://pastebin.com/TjmkVDUM > > Fixture: http://pastebin.com/PujWtqNJ > > > > Thank you. > > > > > > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/symfony-users?hl=en > > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Doctrine dump and then import failing
Hi, I have a big schema, and I needed to add a new Table, so I did, while I am testing, I dumped my DB to a fixture and it works well, but when I try to load it back, it gives me this error: Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references. Going back to the data.yml I delete the newly created record and try importing, and it works. I've isolated the problem to this: The original dump that doesnt work looks like this: Keyword: Keyword_1: Organization: Organization_2 keyword: KW1 However if I change it to the following, it works: Keyword: Keyword_1: organization_id: 2 keyword: KW1 But, this doesn't make sense.. the way doctrine exported it..should work.. not only that.. I have other places in the dump where it works fine: Campaign: Campaign_1: Organization: Organization_2 name: 'Special Sale' description: 'Special Sale Offer' So, why is this not working? please help. Schema: http://pastebin.com/TjmkVDUM Fixture: http://pastebin.com/PujWtqNJ Thank you. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] How to do upgrades
I have a question.. once I finish coding and the site goes into production, I can't rebuild the DB every time I need to add a field etc. How do people workaround this? What is the process for migrations? Thank you. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe, reply using "remove me" as the subject.
[symfony-users] Is there a blog plugin for 1.4?
Is there? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
Re: [symfony-users] sfWidgetFormDoctrineChoice problems
Syam.. that didnt work it gives me an error. $query = Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization); $this->widgetSchema['campaign_id'] = new sfWidgetFormDoctrineChoice(array ( 'model' => 'Campaign', 'query' => $query )); *Fatal error*: Call to undefined method Doctrine_Collection::execute() in * /usr/local/share/symfony-1.4/lib/plugins/sfDoctrinePlugin/lib/widget/sfWidgetFormDoctrineChoice.class.php * on line *86 *Let me know.. I went around it by adding INDEXBY to the query... but i dont think its clean to do it this way without using the doctrine widget. public function getCampaigns(Organization $organization = null) { $q = Doctrine_Query::create() ->from('Campaign c INDEXBY c.id') ->where('c.organization_id =?', $organization->id); return $q->execute(); } On Sat, Mar 6, 2010 at 8:44 AM, Syam wrote: > Hi, > > You can use the sfWidgetFormDoctrineChoice widget with the 'query' option, > thus, you can pass params to your query throught the form option system : > > *In action :* > $this->form = new campaignForm($record, array('organization' => > $user->organization) // or any param you want from $request object > > *In form :* > $query = > Doctrine::getTable('Campaign')->getCampaignsQuery($this->getOption('organization')) > > $this->widgetSchema['campaign_id'] = new sfWidgetFormDoctrineChoice(array > ( > 'model' => 'Campaign', > 'query' => $query > )); > > Hope it help you. > > Samuel Morhaim wrote: > > I have a question, I have a dropdown that needs to be populated from the > database, but with a query, and the query is based on a post variable. > > I know that sfWidgetFormDoctrineChoice has an option for passing a method, > but I can't pass a method + parameter like that. > > So I used the simple sfWidgetFormChoice with the choice value being the > Doctrine getTable and the parameter.. as shown in the bottom of this > email.. HOWEVER, the dropdown is not well populated. The dropdown is > formed like this: > > 20 Off Code > Special Sale > 30 Off > > This is incorrect, since the value for 20 Off Code is not 0 , is actually > 1 so the index is wrong. > > $this->widgetSchema['campaign_id'] = new sfWidgetFormChoice(array > ( > 'choices' => > Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization) > )); > > > What can I do ? > > Thank you. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: sfWidgetFormDoctrineChoice problems
More info: The same widget, generated with sfWidgetFormDoctrineChoice without passing any method for filtering (Notice it has one more value, of course because it is not filtered, but the value = id): Special Sale 30 Off 20 Off Code 20 Off Same field as above but using: = new sfWidgetFormChoice(array('choices' =>Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization))); Special Sale 30 Off 20 Off Code Notice it does filter based on the method, of course, but the value= is now just a 0 index.. no the actual id. Any ideas? This gives me tons of errors of course... On Fri, Mar 5, 2010 at 7:10 PM, Samuel Morhaim wrote: > I have a question, I have a dropdown that needs to be populated from the > database, but with a query, and the query is based on a post variable. > > I know that sfWidgetFormDoctrineChoice has an option for passing a method, > but I can't pass a method + parameter like that. > > So I used the simple sfWidgetFormChoice with the choice value being the > Doctrine getTable and the parameter.. as shown in the bottom of this > email.. HOWEVER, the dropdown is not well populated. The dropdown is > formed like this: > > 20 Off Code > Special Sale > 30 Off > > This is incorrect, since the value for 20 Off Code is not 0 , is actually > 1 so the index is wrong. > > $this->widgetSchema['campaign_id'] = new sfWidgetFormChoice(array > ( > 'choices' => > Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization) > )); > > > What can I do ? > > Thank you. > > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] sfWidgetFormDoctrineChoice problems
I have a question, I have a dropdown that needs to be populated from the database, but with a query, and the query is based on a post variable. I know that sfWidgetFormDoctrineChoice has an option for passing a method, but I can't pass a method + parameter like that. So I used the simple sfWidgetFormChoice with the choice value being the Doctrine getTable and the parameter.. as shown in the bottom of this email.. HOWEVER, the dropdown is not well populated. The dropdown is formed like this: 20 Off Code Special Sale 30 Off This is incorrect, since the value for 20 Off Code is not 0 , is actually 1 so the index is wrong. $this->widgetSchema['campaign_id'] = new sfWidgetFormChoice(array ( 'choices' => Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization) )); What can I do ? Thank you. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Many to many doctrine in forms / embeded forms.
I am having some issues finding a good example on how to display the many to many fields in a form, actually on an embeded form. Can somebody point me in the right direction? Thank you. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Semi public anouncement..
Hello: If anyone is interested in making some extra bucks, I need help creating a form (with a few embedded forms) for an app. This should take you a few hours if you are experienced. Let me know. Thank you. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Calling an action from an outside class
lol yes, sorry, i click sent, and then figured it out. :) On Mon, Mar 1, 2010 at 7:02 PM, Daniel Lohse wrote: > require_once the file and instantiate the Message class... oh man, symfony > is not there for you to completely forget either PHP or plain OOP :) > > Daniel > > On 02.03.2010, at 01:00, Samuel Morhaim wrote: > > Sorry for the dumb question, but now that I moved it to > lib/Message.class.php ... how do I call it from there from within a separate > Class? I manage to call it from within the actions.. > > but now i am in this external class, and i need to call that method ? > > > On Mon, Mar 1, 2010 at 5:57 PM, Daniel Lohse > wrote: > >> Move it out to the model or into the outside class and also call it from >> the action. :) >> >> Daniel >> >> On 01.03.2010, at 23:43, Samuel Morhaim wrote: >> >> Is there a way to call an action, from an outside Class? >> >> I am handling the processing of one of my routines with an outside >> class.. I need to call the exact same code being called in one of my >> actions.. how can i do this? >> >> or should i move the code somewhere else? >> >> thanks. >> >> >> -- >> If you want to report a vulnerability issue on symfony, please send it to >> security at symfony-project.com >> >> You received this message because you are subscribed to the Google >> Groups "symfony users" group. >> To post to this group, send email to symfony-users@googlegroups.com >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en >> >> >> >> -- >> If you want to report a vulnerability issue on symfony, please send it to >> security at symfony-project.com >> >> You received this message because you are subscribed to the Google >> Groups "symfony users" group. >> To post to this group, send email to symfony-users@googlegroups.com >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en >> > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Calling an action from an outside class
Sorry for the dumb question, but now that I moved it to lib/Message.class.php ... how do I call it from there from within a separate Class? I manage to call it from within the actions.. but now i am in this external class, and i need to call that method ? On Mon, Mar 1, 2010 at 5:57 PM, Daniel Lohse wrote: > Move it out to the model or into the outside class and also call it from > the action. :) > > Daniel > > On 01.03.2010, at 23:43, Samuel Morhaim wrote: > > Is there a way to call an action, from an outside Class? > > I am handling the processing of one of my routines with an outside class.. > I need to call the exact same code being called in one of my actions.. how > can i do this? > > or should i move the code somewhere else? > > thanks. > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Calling an action from an outside class
Is there a way to call an action, from an outside Class? I am handling the processing of one of my routines with an outside class.. I need to call the exact same code being called in one of my actions.. how can i do this? or should i move the code somewhere else? thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Why is this fixture not working?
Tom, Thank you for the reply, but I don't think that is the problem. 1. The relation between my Command and Event, is only defined in one side, the Event relations: Command: local: command_id foreign: id type: many cascade: [delete] foreignAlias: Events 2. I added the foreignAlias but that only creates the method getEvents() instead of getEvent() ... however, calling getEvents() is only brginging one record, not a collection of Events. Since my relation Command to Events, is 1 to manny i should be getting a collection back... Any other ideas? Thank you. On Mon, Mar 1, 2010 at 9:39 AM, Tom Ptacnik wrote: > You can look etc into the Practical symfony-jobeet-1.4-doctrine-en.pdf > and there you can see that you have badly set your relations > > look on the JobeetJob - JobeetCategory realation > > 1) specify the relation only on one side > 2) specify the foreignAlias: etc JobeetJobs > ... > > JobeetCategory: > actAs: { Timestampable: ~ } > columns: > name: { type: string(255), notnull: true, unique: true } > > JobeetJob: > actAs: { Timestampable: ~ } > columns: >category_id: { type: integer, notnull: true } >type: { type: string(255) } >company: { type: string(255), notnull: true } > ... > relations: >JobeetCategory: { onDelete: CASCADE, local: category_id, foreign: > id, foreignAlias: JobeetJobs } > > On 1 bře, 06:15, Samuel Morhaim wrote: > > Never mind about this one, but now I am facing one more issue.. Based on > > the below schema.. why is the 1 to many between Command and Events not > > working? I get a method such as $command->getEvent() but it seems to be > > bringing the first record.. not all records.. i cant find a getEvents() > > method.. > > > > Can anyone help? thank you. > > > > Command: > > columns: > > id: > > primary: true > > unique: true > > type: integer > > notnull: true > > autoincrement: true > > rule_id: > > type: integer > > notnull: true > > command: > > type: string(160) > > notnull: false > > relations: > > Rule: > > local: rule_id > > foreign: id > > cascade: [delete] > > > > Event: > > columns: > > id: > > primary: true > > unique: true > > type: integer > > notnull: true > > autoincrement: true > > command_id: > > type: integer > > notnull: true > > name: > > type: string(50) > > notnull: true > > campaign_id: > > type: integer > > notnull: false > > template_id: > > type: integer > > notnull: false > > relations: > > Command: > > local: command_id > > foreign: id > > type: many > > cascade: [delete] > > Campaign: > > local: campaign_id > > foreign: id > > cascade: [delete] > > Template: > > local: template_id > > foreign: id > > > > On Sun, Feb 28, 2010 at 2:42 PM, Samuel Morhaim < > samuel.morh...@gmail.com>wrote: > > > > > > > > > It is a somewhat complex table relation but it should work.. > > > > > A rule, can have a command, the command can have many events. I get > this > > > error: Unknown record property / related component "ev1" on "Event" > > > > > Fixture: > > > Rule: > > > rule_1: > > > id: 1 > > > type: User > > > campaign_id: 1 > > > msg_to: 32075 > > > msg_from: Outbound > > > description: See if the user replies the number 1 or 2 > > > Command: > > > command_1: > > > command: 1 > > > Event: > > > ev1: > > > name: Add > > > ev2: > > > name: Remove > > > command_2: > > > command: 2 > > > > > Schema > > > > > Rule: > > > columns: > > > id: > > > primary: true > > > unique: true > > > type: integer > > > notnull: true > > > autoincrement: true > > > type: > > > type: enum > > > values: [User,System] > > > campaign_id: > > > type: integer > > > notnull: false > > > msg_to:
[symfony-users] Re: Why is this fixture not working?
Anyone? Thank you On 3/1/10, Samuel Morhaim wrote: > Never mind about this one, but now I am facing one more issue.. Based on > the below schema.. why is the 1 to many between Command and Events not > working? I get a method such as $command->getEvent() but it seems to be > bringing the first record.. not all records.. i cant find a getEvents() > method.. > > Can anyone help? thank you. > > Command: > columns: > id: > primary: true > unique: true > type: integer > notnull: true > autoincrement: true > rule_id: > type: integer > notnull: true > command: > type: string(160) > notnull: false > relations: > Rule: > local: rule_id > foreign: id > cascade: [delete] > > Event: > columns: > id: > primary: true > unique: true > type: integer > notnull: true > autoincrement: true > command_id: > type: integer > notnull: true > name: > type: string(50) > notnull: true > campaign_id: > type: integer > notnull: false > template_id: > type: integer > notnull: false > relations: > Command: > local: command_id > foreign: id > type: many > cascade: [delete] > Campaign: > local: campaign_id > foreign: id > cascade: [delete] > Template: > local: template_id > foreign: id > > > > > On Sun, Feb 28, 2010 at 2:42 PM, Samuel Morhaim > wrote: > >> It is a somewhat complex table relation but it should work.. >> >> A rule, can have a command, the command can have many events. I get this >> error: Unknown record property / related component "ev1" on "Event" >> >> >> Fixture: >> Rule: >> rule_1: >> id: 1 >> type: User >> campaign_id: 1 >> msg_to: 32075 >> msg_from: Outbound >> description: See if the user replies the number 1 or 2 >> Command: >> command_1: >> command: 1 >> Event: >> ev1: >> name: Add >> ev2: >> name: Remove >> command_2: >> command: 2 >> >> >> >> Schema >> >> Rule: >> columns: >> id: >> primary: true >> unique: true >> type: integer >> notnull: true >> autoincrement: true >> type: >> type: enum >> values: [User,System] >> campaign_id: >> type: integer >> notnull: false >> msg_to: >> type: string(20) >> notnull: false >> msg_from: >> type: enum >> values: [Anyone,Outbound] >> description: >> type: string(255) >> notnull: false >> is_active: >> default: true >> type: boolean >> notnull: true >> relations: >> Campaign: >> local: campaign_id >> foreign: id >> type: many >> cascade: [delete] >> >> >> Command: >> columns: >> id: >> primary: true >> unique: true >> type: integer >> notnull: true >> autoincrement: true >> rule_id: >> type: integer >> notnull: true >> command: >> type: string(160) >> notnull: false >> relations: >> Rule: >> local: rule_id >> foreign: id >> cascade: [delete] >> >> Event: >> columns: >> id: >> primary: true >> unique: true >> type: integer >> notnull: true >> autoincrement: true >> command_id: >> type: integer >> notnull: true >> name: >> type: string(50) >> notnull: true >> campaign_id: >> type: integer >> notnull: false >> template_id: >> type: integer >> notnull: false >> relations: >> Command: >> local: command_id >> foreign: id >> type: many >> cascade: [delete] >> Campaign: >> local: campaign_id >> foreign: id >> cascade: [delete] >> Template: >> local: template_id >> foreign: id >> >> >> > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Why is this fixture not working?
Never mind about this one, but now I am facing one more issue.. Based on the below schema.. why is the 1 to many between Command and Events not working? I get a method such as $command->getEvent() but it seems to be bringing the first record.. not all records.. i cant find a getEvents() method.. Can anyone help? thank you. Command: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true rule_id: type: integer notnull: true command: type: string(160) notnull: false relations: Rule: local: rule_id foreign: id cascade: [delete] Event: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true command_id: type: integer notnull: true name: type: string(50) notnull: true campaign_id: type: integer notnull: false template_id: type: integer notnull: false relations: Command: local: command_id foreign: id type: many cascade: [delete] Campaign: local: campaign_id foreign: id cascade: [delete] Template: local: template_id foreign: id On Sun, Feb 28, 2010 at 2:42 PM, Samuel Morhaim wrote: > It is a somewhat complex table relation but it should work.. > > A rule, can have a command, the command can have many events. I get this > error: Unknown record property / related component "ev1" on "Event" > > > Fixture: > Rule: > rule_1: > id: 1 > type: User > campaign_id: 1 > msg_to: 32075 > msg_from: Outbound > description: See if the user replies the number 1 or 2 > Command: > command_1: > command: 1 > Event: > ev1: > name: Add > ev2: > name: Remove > command_2: > command: 2 > > > > Schema > > Rule: > columns: > id: > primary: true > unique: true > type: integer > notnull: true > autoincrement: true > type: > type: enum > values: [User,System] > campaign_id: > type: integer > notnull: false > msg_to: > type: string(20) > notnull: false > msg_from: > type: enum > values: [Anyone,Outbound] > description: > type: string(255) > notnull: false > is_active: > default: true > type: boolean > notnull: true > relations: > Campaign: > local: campaign_id > foreign: id > type: many > cascade: [delete] > > > Command: > columns: > id: > primary: true > unique: true > type: integer > notnull: true > autoincrement: true > rule_id: > type: integer > notnull: true > command: > type: string(160) > notnull: false > relations: > Rule: > local: rule_id > foreign: id > cascade: [delete] > > Event: > columns: > id: > primary: true > unique: true > type: integer > notnull: true > autoincrement: true > command_id: > type: integer > notnull: true > name: > type: string(50) > notnull: true > campaign_id: > type: integer > notnull: false > template_id: > type: integer > notnull: false > relations: > Command: > local: command_id > foreign: id > type: many > cascade: [delete] > Campaign: > local: campaign_id > foreign: id > cascade: [delete] > Template: > local: template_id > foreign: id > > > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Why is this fixture not working?
It is a somewhat complex table relation but it should work.. A rule, can have a command, the command can have many events. I get this error: Unknown record property / related component "ev1" on "Event" Fixture: Rule: rule_1: id: 1 type: User campaign_id: 1 msg_to: 32075 msg_from: Outbound description: See if the user replies the number 1 or 2 Command: command_1: command: 1 Event: ev1: name: Add ev2: name: Remove command_2: command: 2 Schema Rule: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true type: type: enum values: [User,System] campaign_id: type: integer notnull: false msg_to: type: string(20) notnull: false msg_from: type: enum values: [Anyone,Outbound] description: type: string(255) notnull: false is_active: default: true type: boolean notnull: true relations: Campaign: local: campaign_id foreign: id type: many cascade: [delete] Command: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true rule_id: type: integer notnull: true command: type: string(160) notnull: false relations: Rule: local: rule_id foreign: id cascade: [delete] Event: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true command_id: type: integer notnull: true name: type: string(50) notnull: true campaign_id: type: integer notnull: false template_id: type: integer notnull: false relations: Command: local: command_id foreign: id type: many cascade: [delete] Campaign: local: campaign_id foreign: id cascade: [delete] Template: local: template_id foreign: id -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Array over a Form
I figured what I was trying to do is easier to just send the ID and re get the DB contents from the other side... i am not pro-json for this.. will look into serialize. thank you. On Tue, Feb 23, 2010 at 5:13 AM, Gareth McCumskey wrote: > JSON isn't supported in PHP until 5.2 and was developed specifically > for JavaScript (JavaScript Object Notation). Serialize is a built-in > PHP function made for PHP, so its better generally to use that if > you're coding in PHP :P. > > Agreed, potatoes potatoes, but often better to use what was built for > the language than what was tacked on later to support a different > language. > > On Tue, Feb 23, 2010 at 11:05 AM, rooster (Russ) wrote: >> >> >> On Feb 23, 8:13 am, Gareth McCumskey wrote: >>> To answer make the value of the hidden field equal to the serialized >>> array >>> >>> http://www.php.net/serialize >>> >> >> Ah yes I misunderstood the question - in my example it is possible but >> a bit silly because you'd need a bunch of hidden fields. If you are >> storing simple arrays, I'd recommend json - but potato potato ;o) >> >>> On Mon, Feb 22, 2010 at 10:42 PM, Samuel Morhaim >>> >>> wrote: >>> > This is maybe a regular html forms question, not neccesarily Symfony.. >>> > but.. how do I send an Array over a Form? is it possible? I have a >>> > hidden field, and I would want to send an Array in it.. is this >>> > possible? >>> >>> > Thanks. >>> >>> > -- >>> > You received this message because you are subscribed to the Google Groups >>> > "symfony users" group. >>> > To post to this group, send email to symfony-us...@googlegroups.com. >>> > To unsubscribe from this group, send email to >>> > symfony-users+unsubscr...@googlegroups.com. >>> > For more options, visit this group >>> > athttp://groups.google.com/group/symfony-users?hl=en. >>> >>> -- >>> Gareth McCumskeyhttp://garethmccumskey.blogspot.com >>> twitter: @garethmcc >> >> -- >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to symfony-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> >> > > > > -- > Gareth McCumskey > http://garethmccumskey.blogspot.com > twitter: @garethmcc > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Array over a Form
This is maybe a regular html forms question, not neccesarily Symfony.. but.. how do I send an Array over a Form? is it possible? I have a hidden field, and I would want to send an Array in it.. is this possible? Thanks. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Hidden Field not rendering
I have the below code.. then WHY is the field campaign_id not getting populated with the default? Only works when I unhide it... Thank you. class AddressBookForm extends BaseAddressBookForm { public function configure() { unset( $this['created_at'], $this['updated_at'], $this['organization_id'], $this['is_active'], $this['id'] ); $this->widgetSchema['campaign_id'] = new sfWidgetFormInputHidden(); } } public function executeShow(sfWebRequest $request) { $this->campaign = Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))); $this->forward404Unless($this->campaign); $this->form = new AddressBookForm(); $this->form->setDefault('campaign_id','1'); $this->address_books = $this->campaign->getAddressBook(); } and a renderHiddenForm in the _form.. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] How to insert data from other actions.
Assuming the below schema.. I am doing the following: Within Campaign , I am showing a record, and within, I am showing a form for addressbook. So how can I get the name of the Campaign I am in, so that I can set it automatically into the form for AddressBook ? Something like.. ... hide the campaign_id for addressbookform ... processForm... addressbook->campaign_id = Current campaign beeing viewed. I hope this makes sense.. Thank you. Organization: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true sf_guard_user_id: type: integer(4) name: unique: true type: string(255) notnull: true first_name: type: string(255) last_name: type: string(255) phone: type: string(255) email: type: string(255) logo: type: string(255) is_active: default: true type: boolean notnull: true indexes: IX_Organization_1: fields: [is_active] IX_Organization_2: fields: [id] relations: sfGuardUser: foreign: id local: sf_guard_user_id owningSide: true type: one foreignType: one Campaign: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true organization_id: type: integer notnull: true name: unique: false type: string(255) notnull: true description: type: blob(0) is_active: default: true type: boolean notnull: true indexes: IX_Campaign_1: fields: [id] IX_Campaign_2: fields: [is_active] relations: Organization: local: organization_id foreign: id AddressBook: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true first_name: type: string(255) last_name: type: string(255) mobile: type: string(20) phone: type: string(255) email: type: string(255) is_active: default: true type: boolean notnull: true campaign_id: type: integer relations: Campaign: local: campaign_id foreign: id -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Simple question...
If I have a field isActive and of course it returns 1 or 0 .. how can I change the class to return Active / Inacrive as a string, and not doing it on the view for each time i use it? Thank you. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] How to get $sf_user from the model
I use the following line in many places, and I want to make it shorter.. since I will never be pulling the information for ALL organizations.. $this->campaigns = Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); I created the method getCampaigns class CampaignTable extends Doctrine_Table { public function getCampaigns(Organization $organization = null) { $q = Doctrine_Query::create() ->from('Campaign c') ->where('c.organization_id =?', $organization->id); return $q->execute(); } Should I have done this differently? If not, then how could I just do $this-campaigns = Doctrine:getCampaigns();// Get all campaigns for logged in user... ? Thank you. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Id being lost on update..
I am using 1.4 and that was auto generated code for the CRUD, then how come this is depreciated? .. Now if i forgot the renderhiddenfields.. is this required whenever you unset fields? ) (my template is complex, since it calls panels for ajax processing.) W On Thu, Feb 18, 2010 at 11:43 AM, Syam wrote: > If you forgot "echo $form->renderHiddenFields();", then "unset($this["id"])" > make sense since the validator don't try to taint the missing value. > > Can you paste your template code please ? > > Samuel Morhaim wrote: > > unseting id worked.. However.. why is this necessary? The generated > Crud, did not do this initially, why is it necessary now? because i > unsetted one element, then i always need to unset id and such ? > > > > On Thu, Feb 18, 2010 at 11:09 AM, Germana Oliveira > wrote: > > > what about: > > unset( > . > $this['id'] > ); > > > 2010/2/18 Daniel Lohse > > > Maybe yu forgot to do "echo $form->renderHiddenFields();" in your form so > the ID that's already assigned to the object is not transmitted when > submitting the form? > > Daniel > > On 18.02.2010, at 16:57, Samuel Morhaim wrote: > > > > > /** > * Campaign Entry Form. > */ > > class CampaignForm extends BaseCampaignForm > { > public function configure() > { > unset( > $this['organization_id'], > $this['is_active'] > ); > > > } > } > > > > On Thu, Feb 18, 2010 at 10:42 AM, Gábor Fási wrote: > > > This looks fine. Can we see your form's configure() method? > > On Thu, Feb 18, 2010 at 16:08, Samuel Morhaim > wrote: > > > Here goes the extra info. :) > > 1. I am just doing a simple edit. (based almost on the generated CRUD > actions) > 2. Yes, it is unique, (schema below). > 3. I am NOT trying to update/modify the ID since it is unique, etc. > THAT IS the problem.. for some reason it trying to set the ID to > empty. OR should not be updating the ID at all, but it is doing it > > > > > Actions: > > public function executeEdit(sfWebRequest $request) > { > $this->forward404Unless($campaign = > > Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), > sprintf('Object campaign does not exist (%s).', > $request->getParameter('id'))); > $this->form = new CampaignForm($campaign); > } > > public function executeUpdate(sfWebRequest $request) > { > $this->forward404Unless($request->isMethod(sfRequest::POST) || > $request->isMethod(sfRequest::PUT)); > $this->forward404Unless($campaign = > > Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), > sprintf('Object campaign does not exist (%s).', > $request->getParameter('id'))); > $this->form = new CampaignForm($campaign); > > $this->processForm($request, $this->form); > > $this->campaigns = > > Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); > $this->setLayout(AJAX_ENABLED); > return $this->renderPartial('campaign/list', array('campaigns' => > $this->campaigns)); > } > > protected function processForm(sfWebRequest $request, sfForm $form) > { > $form->bind($request->getParameter($form->getName()), > $request->getFiles($form->getName())); > if ($form->isValid()) > { > $campaign = $form->save(); > > } > } > > > > == > > > SCHEMA > > Campaign: > columns: > id: > primary: true > unique: true > type: integer > notnull: true > autoincrement: true > organization_id: > type: integer > notnull: true > name: > unique: false > type: string(255) > notnull: true > description: > type: blob(0) > is_active: > default: true > type: boolean > notnull: true > indexes: > IX_Campaign_1: > fields: [id] > IX_Campaign_2: > fields: [is_active] > relations: > Organization: > local: organization_id > foreign: id > > > > === > > > > 2010/2/18 Michał Piotrowski : > > > I'm wondering why do you want to update id? I assume that you are > using id as primary key, so updating it to other value just doesn't > makes sense. > > Maybe someone will help you if you explain what do you want to do. &g
Re: [symfony-users] Re: Id being lost on update..
I had to define it, because initially it was giving me some headaches with just creating the model, so by adding it i got rid of the problem.. Then i created the auto generated CRUD which worked fine for edit, and then i started adding ajax effects and this started happening... 2010/2/18 Michał Piotrowski : > 2010/2/18 Samuel Morhaim : >> unseting id worked.. However.. why is this necessary? The generated >> Crud, did not do this initially, why is it necessary now? because i >> unsetted one element, then i always need to unset id and such ? > > Just guessing - you have defined id column. > >>>> >>> SCHEMA >>>> >>> >>>> >>> Campaign: >>>> >>> columns: >>>> >>> id: >>>> >>> primary: true >>>> >>> unique: true >>>> >>> type: integer >>>> >>> notnull: true >>>> >>> autoincrement: true > > I never do this, because it's defined by default. > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Id being lost on update..
unseting id worked.. However.. why is this necessary? The generated Crud, did not do this initially, why is it necessary now? because i unsetted one element, then i always need to unset id and such ? On Thu, Feb 18, 2010 at 11:09 AM, Germana Oliveira wrote: > what about: > > unset( > . > $this['id'] > ); > > > 2010/2/18 Daniel Lohse >> >> Maybe yu forgot to do "echo $form->renderHiddenFields();" in your form so >> the ID that's already assigned to the object is not transmitted when >> submitting the form? >> >> Daniel >> >> On 18.02.2010, at 16:57, Samuel Morhaim wrote: >> >> > > > >> > /** >> > * Campaign Entry Form. >> > */ >> > >> > class CampaignForm extends BaseCampaignForm >> > { >> > public function configure() >> > { >> > unset( >> > $this['organization_id'], >> > $this['is_active'] >> > ); >> > >> > >> > } >> > } >> > >> > >> > >> > On Thu, Feb 18, 2010 at 10:42 AM, Gábor Fási wrote: >> >> This looks fine. Can we see your form's configure() method? >> >> >> >> On Thu, Feb 18, 2010 at 16:08, Samuel Morhaim >> >> wrote: >> >>> Here goes the extra info. :) >> >>> >> >>> 1. I am just doing a simple edit. (based almost on the generated CRUD >> >>> actions) >> >>> 2. Yes, it is unique, (schema below). >> >>> 3. I am NOT trying to update/modify the ID since it is unique, etc. >> >>> THAT IS the problem.. for some reason it trying to set the ID to >> >>> empty. OR should not be updating the ID at all, but it is doing it >> >>> >> >>> >> >>> >> >>> >> >>> Actions: >> >>> >> >>> public function executeEdit(sfWebRequest $request) >> >>> { >> >>> $this->forward404Unless($campaign = >> >>> >> >>> Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), >> >>> sprintf('Object campaign does not exist (%s).', >> >>> $request->getParameter('id'))); >> >>> $this->form = new CampaignForm($campaign); >> >>> } >> >>> >> >>> public function executeUpdate(sfWebRequest $request) >> >>> { >> >>> $this->forward404Unless($request->isMethod(sfRequest::POST) || >> >>> $request->isMethod(sfRequest::PUT)); >> >>> $this->forward404Unless($campaign = >> >>> >> >>> Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), >> >>> sprintf('Object campaign does not exist (%s).', >> >>> $request->getParameter('id'))); >> >>> $this->form = new CampaignForm($campaign); >> >>> >> >>> $this->processForm($request, $this->form); >> >>> >> >>> $this->campaigns = >> >>> >> >>> Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); >> >>> $this->setLayout(AJAX_ENABLED); >> >>> return $this->renderPartial('campaign/list', array('campaigns' => >> >>> $this->campaigns)); >> >>> } >> >>> >> >>> protected function processForm(sfWebRequest $request, sfForm $form) >> >>> { >> >>> $form->bind($request->getParameter($form->getName()), >> >>> $request->getFiles($form->getName())); >> >>> if ($form->isValid()) >> >>> { >> >>> $campaign = $form->save(); >> >>> >> >>> } >> >>> } >> >>> >> >>> >> >>> >> >>> ====== >> >>> >> >>> >> >>> SCHEMA >> >>> >> >>> Campaign: >> >>> columns: >> >>> id: >> >>> primary: true >> >>> unique: true >> >>> type: integer >> >>> notnull: true >> >>> autoincrement: true >> >&g
Re: [symfony-users] Re: Id being lost on update..
wrote: > This looks fine. Can we see your form's configure() method? > > On Thu, Feb 18, 2010 at 16:08, Samuel Morhaim > wrote: >> Here goes the extra info. :) >> >> 1. I am just doing a simple edit. (based almost on the generated CRUD >> actions) >> 2. Yes, it is unique, (schema below). >> 3. I am NOT trying to update/modify the ID since it is unique, etc. >> THAT IS the problem.. for some reason it trying to set the ID to >> empty. OR should not be updating the ID at all, but it is doing it >> >> >> >> >> Actions: >> >> public function executeEdit(sfWebRequest $request) >> { >> $this->forward404Unless($campaign = >> Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), >> sprintf('Object campaign does not exist (%s).', >> $request->getParameter('id'))); >> $this->form = new CampaignForm($campaign); >> } >> >> public function executeUpdate(sfWebRequest $request) >> { >> $this->forward404Unless($request->isMethod(sfRequest::POST) || >> $request->isMethod(sfRequest::PUT)); >> $this->forward404Unless($campaign = >> Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), >> sprintf('Object campaign does not exist (%s).', >> $request->getParameter('id'))); >> $this->form = new CampaignForm($campaign); >> >> $this->processForm($request, $this->form); >> >> $this->campaigns = >> Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); >> $this->setLayout(AJAX_ENABLED); >> return $this->renderPartial('campaign/list', array('campaigns' => >> $this->campaigns)); >> } >> >> protected function processForm(sfWebRequest $request, sfForm $form) >> { >> $form->bind($request->getParameter($form->getName()), >> $request->getFiles($form->getName())); >> if ($form->isValid()) >> { >> $campaign = $form->save(); >> >> } >> } >> >> >> >> == >> >> >> SCHEMA >> >> Campaign: >> columns: >> id: >> primary: true >> unique: true >> type: integer >> notnull: true >> autoincrement: true >> organization_id: >> type: integer >> notnull: true >> name: >> unique: false >> type: string(255) >> notnull: true >> description: >> type: blob(0) >> is_active: >> default: true >> type: boolean >> notnull: true >> indexes: >> IX_Campaign_1: >> fields: [id] >> IX_Campaign_2: >> fields: [is_active] >> relations: >> Organization: >> local: organization_id >> foreign: id >> >> >> >> === >> >> >> >> 2010/2/18 Michał Piotrowski : >>> I'm wondering why do you want to update id? I assume that you are >>> using id as primary key, so updating it to other value just doesn't >>> makes sense. >>> >>> Maybe someone will help you if you explain what do you want to do. >>> Actually we don't have enough information on such things as: >>> - what do you want to do >>> - what you are doing - iow - show us the code - maybe others are, but >>> I'm not a seer :) >>> >>> Regards, >>> Michal >>> >>> 2010/2/18 Samuel Morhaim : >>>> Anyone? >>>> >>>> On 2/17/10, Samuel Morhaim wrote: >>>>> If it helps.. this is the error, of course because it lost the id.. >>>>> >>>>> SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry >>>>> '0' for key 1 >>>>> stack trace >>>>> >>>>> * at () >>>>> in >>>>> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php >>>>> line 1082 ... >>>>> 1079. $message .= sprintf('. Failing Query: >>>>> "%s"', $query); >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Wed, Feb 17, 2010 at 5:20 PM, Samuel Morhaim >>>>> wrote:
Re: [symfony-users] Re: White screen only in production enviroment
In my case, I was working on a new installed php server, and I had to modify /etc/php.ini to enable errors, etc etc. Not recommended for production envs. so be sure to turn them off before going live. On Thu, Feb 18, 2010 at 9:39 AM, PachinSV wrote: > when I upload a symfony project and receive this kind of error, the > problem is the folder permission. If you are you using Linux in you > prod enviroment, you have to do this: > > - Give 755 recursive permissions to the projects folder > - Give 777 recursive permission to the log and cache folder inside > your project. > - Run this task: ./symfony project:permissions > - Clear cache (./symfony cc) > > I hope this help you. I none of this works, check if the database > connection, or even if you're are using the same structure as the > local one. > > On 17 feb, 07:37, Trailfinder wrote: >> Hi all, >> >> My dev enviroment works great. But when I deploy to my production >> enviroment, I get a white screen only. Strange thing is, my backend is >> working. My frontend only gives white screens. >> >> I can imagine there can be multiple places to look. But is there a way >> to test effectively where the problem is? >> >> Thanks! >> >> B. > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Id being lost on update..
Here goes the extra info. :) 1. I am just doing a simple edit. (based almost on the generated CRUD actions) 2. Yes, it is unique, (schema below). 3. I am NOT trying to update/modify the ID since it is unique, etc. THAT IS the problem.. for some reason it trying to set the ID to empty. OR should not be updating the ID at all, but it is doing it Actions: public function executeEdit(sfWebRequest $request) { $this->forward404Unless($campaign = Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), sprintf('Object campaign does not exist (%s).', $request->getParameter('id'))); $this->form = new CampaignForm($campaign); } public function executeUpdate(sfWebRequest $request) { $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT)); $this->forward404Unless($campaign = Doctrine::getTable('Campaign')->find(array($request->getParameter('id'))), sprintf('Object campaign does not exist (%s).', $request->getParameter('id'))); $this->form = new CampaignForm($campaign); $this->processForm($request, $this->form); $this->campaigns = Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); $this->setLayout(AJAX_ENABLED); return $this->renderPartial('campaign/list', array('campaigns' => $this->campaigns)); } protected function processForm(sfWebRequest $request, sfForm $form) { $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName())); if ($form->isValid()) { $campaign = $form->save(); } } == SCHEMA Campaign: columns: id: primary: true unique: true type: integer notnull: true autoincrement: true organization_id: type: integer notnull: true name: unique: false type: string(255) notnull: true description: type: blob(0) is_active: default: true type: boolean notnull: true indexes: IX_Campaign_1: fields: [id] IX_Campaign_2: fields: [is_active] relations: Organization: local: organization_id foreign: id === 2010/2/18 Michał Piotrowski : > I'm wondering why do you want to update id? I assume that you are > using id as primary key, so updating it to other value just doesn't > makes sense. > > Maybe someone will help you if you explain what do you want to do. > Actually we don't have enough information on such things as: > - what do you want to do > - what you are doing - iow - show us the code - maybe others are, but > I'm not a seer :) > > Regards, > Michal > > 2010/2/18 Samuel Morhaim : >> Anyone? >> >> On 2/17/10, Samuel Morhaim wrote: >>> If it helps.. this is the error, of course because it lost the id.. >>> >>> SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry >>> '0' for key 1 >>> stack trace >>> >>> * at () >>> in >>> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php >>> line 1082 ... >>> 1079. $message .= sprintf('. Failing Query: >>> "%s"', $query); >>> >>> >>> >>> >>> >>> On Wed, Feb 17, 2010 at 5:20 PM, Samuel Morhaim >>> wrote: >>>> I am getting an error when doing a simple edit/update ... the ID of >>>> the item is being lost. >>>> >>>> This is the DB log... maybe somebody can help ? >>>> >>>> >>>> # >>>> >>>> SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name >>>> AS c__name, c.description AS c__description, c.is_active AS >>>> c__is_active FROM campaign c WHERE (c.id = '2') LIMIT 1 >>>> 0.00s, "doctrine" connection Toggle debug stack >>>> #23 » in sfDoctrineConnectionProfiler->preStmtExecute() from >>>> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php >>>> line 494 >>>> #22 » in Doctrine_EventListener_Chain->preStmtExecute() from >>>> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php >>>> line 231 >>>> #21 » in Doctrine_Connection_Statement->execute() from >>>> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php >>>> line
[symfony-users] Re: Id being lost on update..
Anyone? On 2/17/10, Samuel Morhaim wrote: > If it helps.. this is the error, of course because it lost the id.. > > SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry > '0' for key 1 > stack trace > > * at () > in > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php > line 1082 ... > 1079. $message .= sprintf('. Failing Query: > "%s"', $query); > > > > > > On Wed, Feb 17, 2010 at 5:20 PM, Samuel Morhaim > wrote: >> I am getting an error when doing a simple edit/update ... the ID of >> the item is being lost. >> >> This is the DB log... maybe somebody can help ? >> >> >> # >> >> SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name >> AS c__name, c.description AS c__description, c.is_active AS >> c__is_active FROM campaign c WHERE (c.id = '2') LIMIT 1 >> 0.00s, "doctrine" connection Toggle debug stack >> #23 » in sfDoctrineConnectionProfiler->preStmtExecute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php >> line 494 >> #22 » in Doctrine_EventListener_Chain->preStmtExecute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php >> line 231 >> #21 » in Doctrine_Connection_Statement->execute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php >> line 1006 >> #20 » in Doctrine_Connection->execute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php >> line 976 >> #19 » in Doctrine_Query_Abstract->_execute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php >> line 1026 >> #18 » in Doctrine_Query_Abstract->execute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query.php >> line 281 >> #17 » in Doctrine_Query->fetchOne() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php >> line 1611 >> #16 » in Doctrine_Table->find() from >> SF_ROOT_DIR/apps/backend/modules/campaign/actions/actions.class.php >> line 53 >> #15 » in campaignActions->executeUpdate() from >> SF_SYMFONY_LIB_DIR/action/sfActions.class.php line 60 >> #14 » in sfActions->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 92 >> #13 » in sfExecutionFilter->executeAction() from >> SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 78 >> #12 » in sfExecutionFilter->handleAction() from >> SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 42 >> #11 » in sfExecutionFilter->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 >> #10 » in sfFilterChain->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfBasicSecurityFilter.class.php line 72 >> #9 » in sfBasicSecurityFilter->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 >> #8 » in sfFilterChain->execute() from >> SF_ROOT_DIR/plugins/sfDoctrineGuardPlugin/lib/sfGuardRememberMeFilter.class.php >> line 56 >> #7 » in sfGuardRememberMeFilter->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 >> #6 » in sfFilterChain->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfRenderingFilter.class.php line 33 >> #5 » in sfRenderingFilter->execute() from >> SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 >> #4 » in sfFilterChain->execute() from >> SF_SYMFONY_LIB_DIR/controller/sfController.class.php line 229 >> #3 » in sfController->forward() from >> SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 48 >> #2 » in sfFrontWebController->dispatch() from >> SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 170 >> #1 » in sfContext->dispatch() from SF_ROOT_DIR/web/backend_dev.php line >> 13 >> # >> >> SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name >> AS c__name, c.description AS c__description, c.is_active AS >> c__is_active FROM campaign c WHERE (c.id = '') >> 0.00s, "doctrine" connection Toggle debug stack >> #31 » in sfDoctrineConnectionProfiler->preStmtExecute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php >> line 494 >> #30 » in Doctrine_EventListener_Chain->preStmtExecute() from >> SF_SYMFONY_LIB_DIR/plugins/sfDoctrin
[symfony-users] Re: Id being lost on update..
If it helps.. this is the error, of course because it lost the id.. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 1 stack trace * at () in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php line 1082 ... 1079. $message .= sprintf('. Failing Query: "%s"', $query); On Wed, Feb 17, 2010 at 5:20 PM, Samuel Morhaim wrote: > I am getting an error when doing a simple edit/update ... the ID of > the item is being lost. > > This is the DB log... maybe somebody can help ? > > > # > > SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name > AS c__name, c.description AS c__description, c.is_active AS > c__is_active FROM campaign c WHERE (c.id = '2') LIMIT 1 > 0.00s, "doctrine" connection Toggle debug stack > #23 » in sfDoctrineConnectionProfiler->preStmtExecute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php > line 494 > #22 » in Doctrine_EventListener_Chain->preStmtExecute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php > line 231 > #21 » in Doctrine_Connection_Statement->execute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php > line 1006 > #20 » in Doctrine_Connection->execute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php > line 976 > #19 » in Doctrine_Query_Abstract->_execute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php > line 1026 > #18 » in Doctrine_Query_Abstract->execute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query.php > line 281 > #17 » in Doctrine_Query->fetchOne() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php > line 1611 > #16 » in Doctrine_Table->find() from > SF_ROOT_DIR/apps/backend/modules/campaign/actions/actions.class.php > line 53 > #15 » in campaignActions->executeUpdate() from > SF_SYMFONY_LIB_DIR/action/sfActions.class.php line 60 > #14 » in sfActions->execute() from > SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 92 > #13 » in sfExecutionFilter->executeAction() from > SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 78 > #12 » in sfExecutionFilter->handleAction() from > SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 42 > #11 » in sfExecutionFilter->execute() from > SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 > #10 » in sfFilterChain->execute() from > SF_SYMFONY_LIB_DIR/filter/sfBasicSecurityFilter.class.php line 72 > #9 » in sfBasicSecurityFilter->execute() from > SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 > #8 » in sfFilterChain->execute() from > SF_ROOT_DIR/plugins/sfDoctrineGuardPlugin/lib/sfGuardRememberMeFilter.class.php > line 56 > #7 » in sfGuardRememberMeFilter->execute() from > SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 > #6 » in sfFilterChain->execute() from > SF_SYMFONY_LIB_DIR/filter/sfRenderingFilter.class.php line 33 > #5 » in sfRenderingFilter->execute() from > SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 > #4 » in sfFilterChain->execute() from > SF_SYMFONY_LIB_DIR/controller/sfController.class.php line 229 > #3 » in sfController->forward() from > SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 48 > #2 » in sfFrontWebController->dispatch() from > SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 170 > #1 » in sfContext->dispatch() from SF_ROOT_DIR/web/backend_dev.php line 13 > # > > SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name > AS c__name, c.description AS c__description, c.is_active AS > c__is_active FROM campaign c WHERE (c.id = '') > 0.00s, "doctrine" connection Toggle debug stack > #31 » in sfDoctrineConnectionProfiler->preStmtExecute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php > line 494 > #30 » in Doctrine_EventListener_Chain->preStmtExecute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php > line 231 > #29 » in Doctrine_Connection_Statement->execute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php > line 1006 > #28 » in Doctrine_Connection->execute() from > SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php > line 976 > #27 » in Doctrine_Query_Abstract-&g
[symfony-users] Id being lost on update..
I am getting an error when doing a simple edit/update ... the ID of the item is being lost. This is the DB log... maybe somebody can help ? # SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name AS c__name, c.description AS c__description, c.is_active AS c__is_active FROM campaign c WHERE (c.id = '2') LIMIT 1 0.00s, "doctrine" connection Toggle debug stack #23 » in sfDoctrineConnectionProfiler->preStmtExecute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php line 494 #22 » in Doctrine_EventListener_Chain->preStmtExecute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php line 231 #21 » in Doctrine_Connection_Statement->execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php line 1006 #20 » in Doctrine_Connection->execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 976 #19 » in Doctrine_Query_Abstract->_execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 1026 #18 » in Doctrine_Query_Abstract->execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query.php line 281 #17 » in Doctrine_Query->fetchOne() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php line 1611 #16 » in Doctrine_Table->find() from SF_ROOT_DIR/apps/backend/modules/campaign/actions/actions.class.php line 53 #15 » in campaignActions->executeUpdate() from SF_SYMFONY_LIB_DIR/action/sfActions.class.php line 60 #14 » in sfActions->execute() from SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 92 #13 » in sfExecutionFilter->executeAction() from SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 78 #12 » in sfExecutionFilter->handleAction() from SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 42 #11 » in sfExecutionFilter->execute() from SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 #10 » in sfFilterChain->execute() from SF_SYMFONY_LIB_DIR/filter/sfBasicSecurityFilter.class.php line 72 #9 » in sfBasicSecurityFilter->execute() from SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 #8 » in sfFilterChain->execute() from SF_ROOT_DIR/plugins/sfDoctrineGuardPlugin/lib/sfGuardRememberMeFilter.class.php line 56 #7 » in sfGuardRememberMeFilter->execute() from SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 #6 » in sfFilterChain->execute() from SF_SYMFONY_LIB_DIR/filter/sfRenderingFilter.class.php line 33 #5 » in sfRenderingFilter->execute() from SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 #4 » in sfFilterChain->execute() from SF_SYMFONY_LIB_DIR/controller/sfController.class.php line 229 #3 » in sfController->forward() from SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 48 #2 » in sfFrontWebController->dispatch() from SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 170 #1 » in sfContext->dispatch() from SF_ROOT_DIR/web/backend_dev.php line 13 # SELECT c.id AS c__id, c.organization_id AS c__organization_id, c.name AS c__name, c.description AS c__description, c.is_active AS c__is_active FROM campaign c WHERE (c.id = '') 0.00s, "doctrine" connection Toggle debug stack #31 » in sfDoctrineConnectionProfiler->preStmtExecute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/EventListener/Chain.php line 494 #30 » in Doctrine_EventListener_Chain->preStmtExecute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php line 231 #29 » in Doctrine_Connection_Statement->execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php line 1006 #28 » in Doctrine_Connection->execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 976 #27 » in Doctrine_Query_Abstract->_execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Abstract.php line 1026 #26 » in Doctrine_Query_Abstract->execute() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query.php line 281 #25 » in Doctrine_Query->fetchOne() from SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/validator/sfValidatorDoctrineUnique.class.php line 99 #24 » in sfValidatorDoctrineUnique->doClean() from SF_SYMFONY_LIB_DIR/validator/sfValidatorSchema.class.php line 90 #23 » in sfValidatorSchema->clean() from SF_SYMFONY_LIB_DIR/validator/sfValidatorSchema.class.php line 246 #22 » in sfValidatorSchema->postClean() from SF_SYMFONY_LIB_DIR/validator/sfValidatorSchema.class.php line 186 #21 » in sfValidatorSchema->doClean() from SF_SYMFONY_LIB_DIR/validator/sfValidatorSchema.class.php line 90 #20 » in sfValidatorSchema->clean() from SF_SYMFONY_LIB_DIR/form/sfForm.class.php line 247 #19 » in sfForm->doBind() from SF_SYMFONY_LIB_DIR/form/addon/sfFormSymfon
Re: [symfony-users] Redirect to partial
Thank you for all this help. ok setLayout(false) was working, it was just not in the right place.. Ok so last question, I promise.. : I am back at my original dilema : Do I need 2 actions for the same? One action for the general index page... and one for just the table for when a call is made by ajax ???Using $request->isXmlHttpRequest() doesnt work because the call is really not being made via xmlhttp... = This works but it uses 2 actions: == public function executeIndex(sfWebRequest $request) { $this->campaigns = Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); $this->form = new CampaignForm(); } public function executeIndexAjax(sfWebRequest $request) { $this->setLayout(false); $this->campaigns = Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); return $this->renderPartial( 'campaign/list', array( 'campaigns' => $this->campaigns ) ); } public function executeCreate(sfWebRequest $request) { $this->forward404Unless($request->isMethod(sfRequest::POST)); $this->form = new CampaignForm(); $this->processForm($request, $this->form); $this->redirect('campaign/indexAjax'); } == this.. doesnt seem to work since its not an xmlhttp call = public function executeIndex(sfWebRequest $request) { $this->campaigns = Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization); $this->form = new CampaignForm(); if ($request->isXmlHttpRequest()) { // return some in json or xml or any format $this->setLayout(false); return $this->renderPartial( 'campaign/thelist', array( 'campaigns' => $this->campaigns ) ); } } public function executeCreate(sfWebRequest $request) { $this->forward404Unless($request->isMethod(sfRequest::POST)); $this->form = new CampaignForm(); $this->processForm($request, $this->form); $this->redirect('campaign/index'); } On Thu, Feb 11, 2010 at 5:17 PM, Stéphane wrote: > -_-" :-) Thank you. > > > > Before Printing, Think about Your Environmental Responsibility! > Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale! > > > On Thu, Feb 11, 2010 at 11:15 PM, Gunther Konig > wrote: > >> >> >> On Thu, Feb 11, 2010 at 11:10 PM, Stéphane wrote: >> >>> About setLayout(false), check this if it can help (or try to debug the >>> setLayout(false) call using xdebug; can't yet help here) : >>> http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer and >>> search for " >> >> While you are there you can also search for "renderPartial". >> >> -- >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to symfony-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Redirect to partial
Stephane, good point.. thank you. Now, to avoid creating a separate indexSuccess page... how can I disable the layout? I tried $this->setLayout(false); but it keeps bringing up the layout. (And i really want to avoid, having to declare each one to disable on the view.yml ) On Thu, Feb 11, 2010 at 4:49 PM, Stéphane wrote: > Hi, > > You do not redirect to a partial, but redirect to a url to which a route > does match, which has a module and action to dispatch to. > > You can use a partial as a view (V of mvc) used by an action (C of mvc). > So you could use in the appropriate action the $this->setTemplate($*) > > $*: See 'Naming Conventions' in the 'Symfony View' documentation. > > http://www.symfony-project.org/api/1_0/sfAction#method_settemplate > and jobeet tutorial. > > > Cheers, > > > Before Printing, Think about Your Environmental Responsibility! > Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale! > > > On Thu, Feb 11, 2010 at 10:45 PM, Samuel Morhaim > wrote: > >> Hi.. working on my Ajax.. i have a question.. >> How can I do redirect to a partial? >> >> Option 1: >> I turn off layout for each specific action that uses "ajax" but then i >> endup with a method with ajax and without ajax... >> >> Option 2: >> I manage to redirect to a partial so if if($request->isXmlHttpRequest()) >> is true.. then just redirect to a partial.. >> >> >> I want to do option 2. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to symfony-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Redirect to partial
Hi.. working on my Ajax.. i have a question.. How can I do redirect to a partial? Option 1: I turn off layout for each specific action that uses "ajax" but then i endup with a method with ajax and without ajax... Option 2: I manage to redirect to a partial so if if($request->isXmlHttpRequest()) is true.. then just redirect to a partial.. I want to do option 2. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Ajax Forms
Stefan, thank you.. and for the ajax validation? On Wed, Feb 10, 2010 at 1:10 AM, Stefan Paschke wrote: > Hi Samuel > > this is pretty straightforward. Install the sfJqueryReloaded plugin for the > jQuery functionality. This gives you the jq_link_to_remote() and > jq_form_remote_tag() functions (that actually replace previous prototype > functions from symfony 1.0). Both functions are wrappers to jQuery.ajax, the > parameters allow you to specify the id of a html element that you wish to > replace with the return of the ajax calls. For the actions, you just create > regular symfony actions. Instead of returning a view in a separate > success.php file, you can return the view from the action, with > > return $this->renderPartial( 'module/partial', array( 'param' => $param ) > ); > > This is documented nicely somewhere, but I forgot where :-) Now to submit > the form and add a new entry to the list, I usually reload the entire block > that contains list and form, with the new entry added to the list, and an > empty form. To delete an entry from the from, you could just replace the > block that contains the form. Sometimes, it may also be appropriate to write > a jQuery function that removes one row from the list and sends a delete call > to the server which is not answered. > > regards > > Stefan > > > On Feb 10, 2010, at 5:48 AM, Samuel Morhaim wrote: > > > Absalon, thank you.. this shed some light... and I got part of it > working, however I am still having issues. > > > > I managed to display the list and the form on the same screen, and > submiting it side by side, it adds a new record to the table (by refreshing > the entire page.. ) > > > > I still have issues how to execute the remote and also, how to do ajax > validations. Using Symfony 1.4. > > > > It seems since they removed it remote on 1.4, and the manual doesn't talk > much about it its hard to find information (at least for me). > > > > Anyone? > > > > Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Ajax Forms
Absalon, thank you.. this shed some light... and I got part of it working, however I am still having issues. I managed to display the list and the form on the same screen, and submiting it side by side, it adds a new record to the table (by refreshing the entire page.. ) I still have issues how to execute the remote and also, how to do ajax validations. Using Symfony 1.4. It seems since they removed it remote on 1.4, and the manual doesn't talk much about it its hard to find information (at least for me). Anyone? Thank you. On Tue, Feb 9, 2010 at 10:01 PM, Absalón Valdés wrote: > hi. i apologize for my english. i,ll try to help. > you can use jQuery or any else javascript library for submiting forms with > ajax: > >- > > http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/ > > you see? well, after submit form you should refresh table. for deleting > items from a table I think you should traverse table records and get a > specific record across columns in a row and then submit the delete action > with ID as parameter, as batch actions. > > 2010/2/9 Samuel Morhaim > >> Anyone? >> >> >> On Tue, Feb 9, 2010 at 3:12 PM, Samuel Morhaim >> wrote: >> >>> Can somebody show me or point me in the right direction for doing: >>> >>> 1. Same-screen form edits. (For example adding an entry to a table with a >>> form on the same screen without re-navigating) >>> 2. Deleting items from a table without re-navigating >>> >>> >>> I know there are examples for sf 1.2 but it was removed on 1.4 and with >>> the plugin there are no examples. >>> >>> Thank you. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to symfony-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Re: Ajax Forms
Anyone? On Tue, Feb 9, 2010 at 3:12 PM, Samuel Morhaim wrote: > Can somebody show me or point me in the right direction for doing: > > 1. Same-screen form edits. (For example adding an entry to a table with a > form on the same screen without re-navigating) > 2. Deleting items from a table without re-navigating > > > I know there are examples for sf 1.2 but it was removed on 1.4 and with the > plugin there are no examples. > > Thank you. > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Ajax Forms
Can somebody show me or point me in the right direction for doing: 1. Same-screen form edits. (For example adding an entry to a table with a form on the same screen without re-navigating) 2. Deleting items from a table without re-navigating I know there are examples for sf 1.2 but it was removed on 1.4 and with the plugin there are no examples. Thank you. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Admin generator without CSS
Hi, I am just testing a bit the admin generator on sf 1.4 and it shows completly without any CSS.. so I looked at the source code and it is pointing to CSS on the sfDoctrinePlugin , of course it can't find it... Any ideas how to fix it? I thought doctrine was included ? -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Help with Schema
I think the many to many on CampaignAddressBook is not working properly. I don't get any errors, but the generated CRUD shows me an input text for Campaign, instead of a dropdown which i was expecting, based on the Campaign Records.. On Tue, Feb 9, 2010 at 3:23 AM, Raphael Schumacher < m...@raphaelschumacher.ch> wrote: > Can you maybe tell us at which step are you stuck? E.g. what errors > you get? > So we can focus on the problem... > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Help with Schema
I am trying to create the following schema with the following requirements. * One to one Organization to sfGuardUser * Each organization, may have multiple campaigns. * Each campaign may have multiple addressbooks. * MessageQueue holds general information for all organizations/campaigns/addressbooks Please let me know what should I do to make it correct... thank you. # config/doctrine/schema.yml Organization: actAs: { Timestampable: ~ } columns: sf_guard_user_id: { type: integer(4) } name: { type: string(255), notnull: true, unique: true } first_name: { type: string(255) } last_name:{ type: string(255), notnull: true } phone:{ type: string(20) } mobile: { type: string(20) } email:{ type: string(255), notnull: true } logo: { type: string(255) } is_active:{ type: boolean, notnull: true, default: 1 } relations: sfGuardUser: foreign: id local: sf_guard_user_id owningSide: true type: one foreignType: one Campaign: actAs: { Timestampable: ~ } columns: organization_id: { type: integer, notnull: true } name: { type: string(255), notnull: true, unique: false } keyword: { type: string(8), notnull: true, unique: true } relations: Organization: local: organization_id foreign: id foreignType: many AddressBook: actAs: { Timestampable: ~ } columns: organization_id: { type: integer, notnull: true } campaign_id: { type: integer, notnull: true } first_name: { type: string(255) } last_name: { type: string(255), notnull: true } mobile: { type: string(20) } email: { type: string(255) } is_active: { type: boolean, notnull: true, default: 1 } relations: Organization: local: organization_id foreign: id foreignType: many CampaignAddressBook: columns: campaign_id: { type: integer, primary: true } address_book_id: { type: integer, primary: true } relations: Campaign: { onDelete: CASCADE, local: campaign_id, foreign: id } AddressBook: { onDelete: CASCADE, local: address_book_id, foreign: id } MessageQueue: actAs: { Timestampable: ~ } columns: organization_id: { type: integer, notnull: true } address_book_id: { type: integer, notnull: false } msg_from:{ type: string(255) } msg_to: { type: string(255) } message_content: { type: string(255) } status: type: enum values: [Pending,Delivered,Processed,Failed] notnull: true result_code: { type: string(255) } direction: type: enum values: [Inbound,Outbound] notnull: true keyword: { type: string(20) } message_option: { type: string(255) } data:{ type: string(255) } response_type: type: enum values: [NORMAL,UNKNOWN] notnull: false delivery_type: type: enum values: [SMS,Email] carrier: { type: string(100) } network_type: type: enum values: [gsm,cdma,tdma,iden] notnull: false received_at: { type: timestamp, notnull: false } relations: Organization:{ local: organization_id, foreign: id } AddressBook: { local: address_book_id, foreign: id } -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Proper way to access object..
I am trying to access the object of the extended profile for sfguard.. http://pastebin.com/md823309 How is the correct way of doing that? # config/doctrine/schema.yml Organization: actAs: { Timestampable: ~ } columns: sf_guard_user_id: { type: integer(4) } name: { type: string(255), notnull: true, unique: true } first_name: { type: string(255) } last_name:{ type: string(255), notnull: true } phone:{ type: string(20) } mobile: { type: string(20) } email:{ type: string(255), notnull: true } logo: { type: string(255) } is_active:{ type: boolean, notnull: true, default: 1 } relations: sfGuardUser: foreign: id local: sf_guard_user_id ??? echo $this->getUser()->getOrganization()->first_name; http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Error on extending profile for sfguard
I removed the primary: true and it worked.. i hope this helps. On Mon, Feb 8, 2010 at 4:46 PM, Samuel Morhaim wrote: > I found this > http://jonocode.wordpress.com/2009/07/11/adding-sf_guard_user_profile-to-the-sfdoctrineguardplugin/ > but still get the issue, can't fix it... > > > My complete schema and eror are here http://pastebin.com/m4a2812bd in > case anyone wants to help.. thanks.. > > > > On Mon, Feb 8, 2010 at 3:07 PM, Filipe wrote: > >> same problem here >> >> >> On Feb 8, 7:16 pm, Samuel Morhaim wrote: >> > What am I doing wrong? I keep getting errors rebuilding and also >> importing >> > fixtures.. >> > >> > Schema >> > # config/doctrine/schema.yml >> > Organization: >> > actAs: { Timestampable: ~ } >> > columns: >> > sf_guard_user_id: { type: integer(5) } >> > name: { type: string(255), notnull: true, unique: true } >> > first_name: { type: string(255) } >> > last_name:{ type: string(255), notnull: true } >> > phone:{ type: string(20) } >> > mobile: { type: string(20) } >> > email:{ type: string(255), notnull: true } >> > logo: { type: string(255) } >> > is_active:{ type: boolean, notnull: true, default: 1 } >> > relations: >> > User: >> > class: sfGuardUser >> > type: one >> > >> > Error: >> > >> > >> doctrine created tables successfully >> > >> > SQLSTATE[HY000]: General error: 1005 Can't create table >> > './zd2/#sql-6d40_252e2.frm' (errno: 150). Failing Query: "ALTER TABLE >> > organization ADD CONSTRAINT >> organization_sf_guard_user_id_sf_guard_user_id >> > FOREIGN KEY (sf_guard_user_id) REFERENCES sf_guard_user(id)". Failing >> Query: >> > ALTER TABLE organization ADD CONSTRAINT >> > organization_sf_guard_user_id_sf_guard_user_id FOREIGN KEY >> > (sf_guard_user_id) REFERENCES sf_guard_user(id) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to symfony-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
Re: [symfony-users] Re: Error on extending profile for sfguard
I found this http://jonocode.wordpress.com/2009/07/11/adding-sf_guard_user_profile-to-the-sfdoctrineguardplugin/ but still get the issue, can't fix it... My complete schema and eror are here http://pastebin.com/m4a2812bd in case anyone wants to help.. thanks.. On Mon, Feb 8, 2010 at 3:07 PM, Filipe wrote: > same problem here > > > On Feb 8, 7:16 pm, Samuel Morhaim wrote: > > What am I doing wrong? I keep getting errors rebuilding and also > importing > > fixtures.. > > > > Schema > > # config/doctrine/schema.yml > > Organization: > > actAs: { Timestampable: ~ } > > columns: > > sf_guard_user_id: { type: integer(5) } > > name: { type: string(255), notnull: true, unique: true } > > first_name: { type: string(255) } > > last_name:{ type: string(255), notnull: true } > > phone:{ type: string(20) } > > mobile: { type: string(20) } > > email:{ type: string(255), notnull: true } > > logo: { type: string(255) } > > is_active:{ type: boolean, notnull: true, default: 1 } > > relations: > > User: > > class: sfGuardUser > > type: one > > > > Error: > > > > >> doctrine created tables successfully > > > > SQLSTATE[HY000]: General error: 1005 Can't create table > > './zd2/#sql-6d40_252e2.frm' (errno: 150). Failing Query: "ALTER TABLE > > organization ADD CONSTRAINT > organization_sf_guard_user_id_sf_guard_user_id > > FOREIGN KEY (sf_guard_user_id) REFERENCES sf_guard_user(id)". Failing > Query: > > ALTER TABLE organization ADD CONSTRAINT > > organization_sf_guard_user_id_sf_guard_user_id FOREIGN KEY > > (sf_guard_user_id) REFERENCES sf_guard_user(id) > > -- > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
[symfony-users] Error on extending profile for sfguard
What am I doing wrong? I keep getting errors rebuilding and also importing fixtures.. Schema # config/doctrine/schema.yml Organization: actAs: { Timestampable: ~ } columns: sf_guard_user_id: { type: integer(5) } name: { type: string(255), notnull: true, unique: true } first_name: { type: string(255) } last_name:{ type: string(255), notnull: true } phone:{ type: string(20) } mobile: { type: string(20) } email:{ type: string(255), notnull: true } logo: { type: string(255) } is_active:{ type: boolean, notnull: true, default: 1 } relations: User: class: sfGuardUser type: one Error: >> doctrine created tables successfully SQLSTATE[HY000]: General error: 1005 Can't create table './zd2/#sql-6d40_252e2.frm' (errno: 150). Failing Query: "ALTER TABLE organization ADD CONSTRAINT organization_sf_guard_user_id_sf_guard_user_id FOREIGN KEY (sf_guard_user_id) REFERENCES sf_guard_user(id)". Failing Query: ALTER TABLE organization ADD CONSTRAINT organization_sf_guard_user_id_sf_guard_user_id FOREIGN KEY (sf_guard_user_id) REFERENCES sf_guard_user(id) -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.