[symfony-users] Re: Day 1 - jobeet problem
Try with frontend_dev.php because index.php (the production controller) does not print out error messages. Also try to put there a phpinfo.php that prints out the phpinfo() so you can check if all your settings are allright. gabriel On Jun 22, 7:30 pm, Christian wrote: > Hi! > > my name is christian and i'm new with symfony framework. > > I found this step by step > tutorial:http://www.symfony-project.org/jobeet/1_2/Propel/it/01 > > i have troubles during the apache configuration... > > this is my httpd.conf > > ___ __ > # Be sure to only have this line once in your > #configuration > NameVirtualHost 127.0.0.1:8080 > > # This is the configuration for your project > Listen 127.0.0.1:8080 > > > DocumentRoot "/home/chris/public_html/jobeet/web" > DirectoryIndex index.php > > AllowOverride All > Allow from All > > > Alias /sf /home/chris/public_html/jobeet/web/lib/vendor/symfony/data/ > web/sf > data/web/sf"> > AllowOverride All > Allow from All > > > ___ > > where public_html is my apcahe DocumentRoot in whitch i have a lot of > directory with different site, but when i put this link in my > browser:http://localhost:8080/index.php(as the tutorial say) i can't see > anything...only a blank page... > > can you help me please? > > thanks > Chris -- 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: fieldset
well, depends on your needs. can you share more details? since $form prints you only list-elements, you can always decorate it with a by yourself. if you want it more advanced and automatically, you could create your own decorator. Have a look into this post: http://www.thatsquality.com/articles/7-days-of-symfony-1-1-forms-widgets-and-validators-day7 this is still valid for symfony 1.4 for a checkbox list with different labels you could create something like this: $this->widgetSchema['member_type'] = new sfWidgetFormChoice(array( 'choices' => array( 'B' => 'Boss', 'U' => 'User' ), 'expanded' => true, 'renderer_options' => array('template' => '%group% %options%') )); -- 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: backend module
Hi, for 1) see http://www.symfony-project.org/jobeet/1_4/Doctrine/en/12#chapter_12_templates_customization you can copy out of your cache folder /cache/APP/ENV/modules/MODULENAME/templates/_list_actions.php to your module template folder and then remove the link for 2) then just change the filter in the corresponding class by replacing the widget $this->widgetSchema['user_id'] = new sfWidgetFormFilterInput(array('with_empty' => false)) Hope that helps Susan -- 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: Symfony 2 Online Conference
For those unfortunate enough to have missed the conference I tried to wrap it all up here: State of #Symfony 2 online conference - a killer feature revealed! - http://bit.ly/cU5KOi Cheers /Christian On Jun 23, 4:58 am, Eno wrote: > Anyone attending the online conference tomorrow? I didn't receieve any > technical info on how to join the conference and my email asking for info > bounced back (with an error message in French malheureusement!). > > Maybe someone at Sensio can help me? > > -- -- 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] Symfony 2 Online Conference
Anyone attending the online conference tomorrow? I didn't receieve any technical info on how to join the conference and my email asking for info bounced back (with an error message in French malheureusement!). Maybe someone at Sensio can help me? -- -- 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] Route does not add a parameter when its defined as a default one.
Remember the orderf of routes *does* matter, so you should have most specific route to least specific routes, e.g. using a wildcard will match all routes that start /blog so probably that route should be last. On Tue, 22 Jun 2010, Ivo Az. wrote: > Here's examples: > > Link > > > Route 1 > blog: > url: /blog/* > param: { module: blog, action: list } > > Output: http://localhost/blog/page/2 > > Route 2 > blog: > url: /blog/:page > param: { module: blog, action: list, page: 1 } > > Output: http://localhost/blog/2 > > Route 3 > blog: > url: /blog/* > param: { module: blog, action: list, page: 1 } > > Output: http://localhost/blog > > Why in 3rd case the url does not contain the page parameter as in > first example? > > -- 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] Day 1 - jobeet problem
On Tue, 22 Jun 2010, Christian wrote: > where public_html is my apcahe DocumentRoot in whitch i have a lot of > directory with different site, but when i put this link in my browser: > http://localhost:8080/index.php (as the tutorial say) i can't see > anything...only a blank page... > > can you help me please? Look at your Apache error log. -- -- 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: Problems in executeUpdate when trying to extend a form
Nevermind, I was trying to merge a form and there was a conflict with the "id" DB fields. I use embedForm now and it works perfectly... On 22 juin, 18:20, John wrote: > Hi, > > I have a problem when trying to use a MyProfileForm that extends the > BasesfGuardUserForm. Here it is : > > In sfGuardUser/action.class.php : > > ... > public function executeMyProfile() { > $this->sf_guard_user = $this->getUser()->getGuardUser(); > $this->form = new MyProfileForm($this->sf_guard_user); > $this->setTemplate('edit'); > } > ... > > My problem here is at the update : it loads the page with errors on > the sfGuardUserForm, and not on the MyProfileForm. So I tried > overriding the executeUpdate method : > > public function executeUpdate(sfWebRequest $request) { > $this->sf_guard_user = $this->getRoute()->getObject(); > $this->form = new MyProfileForm($this->sf_guard_user); > $this->form->bind($request->getParameter("sf_guard_user")); > if ($this->form->isValid()) { > echo "valid"; exit; > } else { > > } > } > > At the update, symfony tells me there is already a user with the > username given. I'm guessing it's trying to add a new object, while I > just want an update ! > > I think my problem is that the method > $this->configuration->getForm($this->sf_guard_user); always gives me the > sfGuardUserForm, > > though I pass a MyProfileForm. > > Anyone had this problem before ? > Any solution ? > > Thanks a lot ! > John -- 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: Doctrine schema: two realtionships between two tables
If you are using propel you can achieve it this way (I don't know if it'll work for Doctrine, I have never used it for any project): Gallery: columns: name: { type: string(255), notnull: true } preview_image_id: { type: integer, foreignTable: GalleryPicture, foreignReference: id } If you let the preview_image_id to be null then you will be able to create empty galleries without having a circular dependency problem. If you set it to "not null" then you will have to create a image to create the gallery and a gallery to create the image... well that's what I mean with "circular dependency". Hope this helps. -- 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 queries in web debug toolbar are not shown correctly (sf 1.4)
Hi, when I look at my web debug toolbar I see the database panel with 6 queries. The time is always: 0.00s, "doctrine" connection which seems to be not correct. But there is a much bigger problem: It does not show all queries, because in the log file I see much more queries and when I open the Timers panel I see: Database (Doctrine) 41 0.440 Is there an option or something I need to setup so the profiling works correctly? regards, Matthias -- 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: routing question?
I would not put this on the routing system. It sounds like all you need is one route that maps your urls to your product catalog action, and figure out which product to show from there. For example, the route could be: product: url: /:manufacturer-:type param: { module: catalog, action: showProduct } >From there you just look up the product from the database, and you can also choose to shave off the 's' if that's your custom business rule.. Personally, I would handle the plurals by adding a rule to my .htaccess file that redirects product urls ending with s to their singular version, so that I don't have 2 urls pointing to the same page (seo dilution issue). Does that make sense so far? Let me know if not. Daniel On Jun 20, 8:30 am, John wrote: > Hi, > > I think this is a routing question. > > For SEO reasons, I need urls like the following: > > www.domain.com/acme-pump.htmlwww.domain.com/beta-pump.htmlwww.domain.com/boyden-pump.html > ... > > and also: > > www.domain.com/acme-pumps.htmlwww.domain.com/beta-pumps.htmlwww.domain.com/boyden-pumps.html > > (Note the "s" on pumps). > > There are about a thousand brand names. I need the "acme", "beta", > "boyden" parts of the urls to come out of a database - the "-pump" or > "-pumps" part can be hard coded. > > Obviously, I can't create a separate module for each of the brands. > > I keep thinking that is a routing problem, but nothing I've tried in > routing.yml works. Maybe I've got the wrong idea? > > Any clues would be gratefully received. > > Thanks, > > John -- 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 fails on insert new value
Hello! I got this error while added new value on standrd form generated by default. execute : SELECT r.sprint_id AS r__sprint_id, r.sprint_name AS r__sprint_name, r.sprint_start AS r__sprint_start, r.sprint_end AS r__sprint_end, r.sprint_summary AS r__sprint_summary, r.created AS r__created FROM rank_sprints r WHERE (r.sprint_id = ?) LIMIT 1 - () SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" I guess this happened 'cause of serial ype of primary key but I'm not sure. Nevertheless here is yml of the table: rank_sprints: columns: sprint_id: primary: true type: serial sprint_name: unique: true type: string(255) notnull: true sprint_start: type: date notnull: true sprint_end: type: date notnull: true sprint_summary: type: string created: default: 'now' type: timestamp notnull: true And forms were generated by default as php symfony doctrine:build --model php symfony doctrine:build --forms php symfony doctrine:build --sql php symfony doctrine:insert-sql php symfony doctrine:generate-module --with-show --non-verbose- templates frontend sprins rank_sprints If any one could help me why It is happened please! -- 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] Symfony "design" issue
Hello all, Another engineer and I are having a bit of a debate on the correct way to handle how Symfony automatically regenerates the session id when authentication, and changing credentials. We have to make a modification to the database whenever a session is regenerated when a user is logged in. So my initial thought would be to extend the sfBasicSecurityUser class and have it dispatch a notification so another part of the system can pick it up whenever credentials are added/removed. The other engineer believes we should extend the session storage class and modify it directly, then pass this to the sfBasicSecurityUser. To my knowledge, the sfBaicSecurityUser class is meant to be able to accept any kind of sfStorage class, not specific the session storage class even though it's kind of assumed. He thinks we should extend whichever class we currently want to use, if it's session then extend that, if later down the road we want to use MySQL then modify the mySession class and tell it to extend MySQL instead. So instead of simply modifying what storage is sent to the sfBasicSecurityUser, you'd have to modify the mySession and change what it extends. I'm not looking to be right or wrong, I'm interested what others opinions are and if they have even a better option. -- 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: Fixture : How to define fixtures by environment
Hi there I recently wrote an article on how to achieve exactly what you are after: http://ezzatron.com/2010/06/10/per-environment-fixtures-in-symfony/ Hope this helps :) Erin On May 7, 6:05 pm, Dong YANG wrote: > Okay, i see, thanks again and have a good week-end :) > > JoJo > > 2010/5/7 Pietrino Atzeni > > > > > Yes, it not environment dependent. Just to make it a little more clear, > > note that it's best to define a different directory for production data, > > with > > > --dir=data/prod-fixtures > > > since fixtures are loaded recursively. > > > You can use the same idea when modifying the db: you can create ad hoc > > migrations, and prepopulate the new fields using something like: > > > --dir=data/migration-fixtures/015 > > > Hope this helps > > Pietro > > > Thanks for your reply. > > >> I think that using a custom fixture directory is the only > >> solution, because fixture yaml itself is not environment-aware, isn't it? > > >> Please correct me if I'm wrong. > > >> Thanks and Regards, > > >> JoJo > > >> I would like to know the best way to define fixtures by > >> environment. > > >> For example, I need some *basic fixtures *for dev/test/prod > >> environment, and some *data fixtures *only for dev and test > >> environment. > >> So when Prod environment, I just load basic fixtures. > > >> I think that this could be done by defined a custom fixture > >> directory, and launch the data-load with option --*dir*, but is > >> this > >> only way to do this or there is better solution? > > >> Any suggestion is welcomed. > > >> Thanks and Regards, > > >> JoJo > > >> Yes, you can use that option --dir, or you can define a task that > >> makes all your deployment to the test/prod environments: rsync, set > >> permissions, migrate db, load fixtures. > > >> Hope this helps, > >> Pietro > > > -- > > 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 > athttp://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] Day 1 - jobeet problem
Hi! my name is christian and i'm new with symfony framework. I found this step by step tutorial: http://www.symfony-project.org/jobeet/1_2/Propel/it/01 i have troubles during the apache configuration... this is my httpd.conf _ # Be sure to only have this line once in your #configuration NameVirtualHost 127.0.0.1:8080 # This is the configuration for your project Listen 127.0.0.1:8080 DocumentRoot "/home/chris/public_html/jobeet/web" DirectoryIndex index.php AllowOverride All Allow from All Alias /sf /home/chris/public_html/jobeet/web/lib/vendor/symfony/data/ web/sf AllowOverride All Allow from All ___ where public_html is my apcahe DocumentRoot in whitch i have a lot of directory with different site, but when i put this link in my browser: http://localhost:8080/index.php (as the tutorial say) i can't see anything...only a blank page... can you help me please? thanks Chris -- 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] Unknown method SfGuardUser::checkPassword
Hello, After installing sfDoctrineApplyPlugin and calling the Apply in a module . A message appeared telling that SfGuardUserFilter was missing. I proceed to recreate the model filters and forms. Then after recreating everything some files were missing. I copied the files in /model/doctrine/sfGuardPlugin to /model/doctrine and the files in /model/doctrine/sfGuardplugin/base to /model/doctine/base After that The apply worked BUT when I try to log in to sfGuardUser this message appears: --- 500 | Internal Server Error | Doctrine_Record_UnknownPropertyException Unknown method SfGuardUser::checkPassword Thanks for your help!. -- 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] Route does not add a parameter when its defined as a default one.
Here's examples: Link Route 1 blog: url: /blog/* param: { module: blog, action: list } Output: http://localhost/blog/page/2 Route 2 blog: url: /blog/:page param: { module: blog, action: list, page: 1 } Output: http://localhost/blog/2 Route 3 blog: url: /blog/* param: { module: blog, action: list, page: 1 } Output: http://localhost/blog Why in 3rd case the url does not contain the page parameter as in first example? -- 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] fieldset
Hi, Is there any way to have fieldset in symfony forms? -- 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: Get record id and set it into form
When you say 'merged two forms' did you use the embedForm() or mergeForm() or did you do this manually? Assuming that the table_a_id is the foreign key for the record in table b, Symfony will deal with this for you if you use merged or embedded forms - see "Doing More With Symfony" - Advanced Forms: http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms On Jun 21, 8:00 am, Tom Ptacnik wrote: > I think that the solution might be owerwriting the doSave method .. or > some method where the saving of the object is done. You need to save > the foreign object first - to obtain the id from the database, then > save the main object. > > On 19 čvn, 12:24, titiyoyo wrote: > > > > > Hi there, > > > i'm new to symfony and am bumping into a problem here. > > I merged two forms from 2 different models and need to get a foreign > > key from table A to put in this table B form. > > > Basically, i have to > > - create a record in table A and get this record's id > > - create a record in table B an set it's table_a_id to the value i > > just got > > - fill out the rest of the info that will be put in table B > > > My question is : > > how can i get the needed 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] backend module
Hi I have created a backend module to display logs (from the logs table or model). 1. since it should just display logs, there shouldn't be a "+new" link in the page. How can I remove that link? 2. I want to be able to filter the list based on the user field. but since the table (model) has the user_id, the filter form displays the users as a drop-down menu which is not desirable at all. I want to have an edit box instead. any suggestion? Thanks in advance -- 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: Change the maxperpage value for the pager
Don't use ajax - instead directly submit the form onchange of the selectbox. This way the page is automatically reloaded when someone changes the value in the select box. Achieving the same effect without reloading the entire page might be possible but would involve quite a lot of work for little gain. Claudia -- 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] routing question?
Hi, I think this is a routing question. For SEO reasons, I need urls like the following: www.domain.com/acme-pump.html www.domain.com/beta-pump.html www.domain.com/boyden-pump.html ... and also: www.domain.com/acme-pumps.html www.domain.com/beta-pumps.html www.domain.com/boyden-pumps.html (Note the "s" on pumps). There are about a thousand brand names. I need the "acme", "beta", "boyden" parts of the urls to come out of a database - the "-pump" or "-pumps" part can be hard coded. Obviously, I can't create a separate module for each of the brands. I keep thinking that is a routing problem, but nothing I've tried in routing.yml works. Maybe I've got the wrong idea? Any clues would be gratefully received. Thanks, John -- 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 schema: two realtionships between two tables
Hi, I need a little help creating my schema. I am creating a gallery- module containing the two tables Gallery and GalleryPicture. First one stores the galleries with additional information, the second one stores the pictures. The tables are related over the gallery.id-field and the gallerypictures.gallery_id-field. Here you see the schema: Gallery: columns: name: { type: string(255), notnull: true } preview_image: { type: integer, default: NULL } GalleryPicture: columns: gallery_id: { type: integer } filename: { type: string(255), notnull: true } relations: Gallery: alias: Gallery foreignAlias: Pictures foreign: id local: gallery_id onDelete: CASCADE I want to define a preview image for every gallery. This image would be an image out of the GalleryPictures table. How can I declare this additional relationship? Thanks in advance! =) -- 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 error (serial type of field, PostgreSQL, symfony 1.4.5, doctrine model)
This happened after I insert new value to table: symfony SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" Form for inserted is auto-generated with php symfony doctrine:generate-module --with-show --non-verbose- templates frontend sprints rank_sprints schema.yml: rank_sprints: columns: sprint_id: primary: true type: serial sprint_name: unique: true type: string(255) notnull: true sprint_start: type: date notnull: true sprint_end: type: date notnull: true sprint_summary: type: string created: default: 'now' type: timestamp notnull: true all code is auto-generated, there were no manual editings... There is call-stack 1 Info sfPatternRouting Match route "default" (/:module/:action/*) for /sprints/edit/sprint_id/ with parameters array ( 'module' => 'sprints', 'action' => 'edit', 'sprint_id' => '',) 2 Info sfFilterChain Executing filter "sfRenderingFilter" 3 Info sfFilterChain Executing filter "sfExecutionFilter" 4 Info sprintsActions Call "sprintsActions->executeEdit()" 5 Info Doctrine_Connection_Pgsql exec : SET NAMES 'UTF8' - () 6 Info Doctrine_Connection_Statement execute : SELECT r.sprint_id AS r__sprint_id, r.sprint_name AS r__sprint_name, r.sprint_start AS r__sprint_start, r.sprint_end AS r__sprint_end, r.sprint_summary AS r__sprint_summary, r.created AS r__created FROM rank_sprints r WHERE (r.sprint_id = ?) LIMIT 1 - () 7 Error Doctrine_Connection_Pgsql_Exception SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" 8 Info sfWebResponse Send status "HTTP/1.1 500 Internal Server Error" 9 Info sfWebResponse Send header "Content-Type: text/html; charset=utf-8" -- 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: Get record id and set it into form
ok that's solved now ! Yes Tom you were right, but it has to be done in the executeCreate action instead of executeNew so here's the code : //ArtisteForm class class ArtisteForm extends BaseArtisteForm { public function configure() { unset( $this["id_fiche"] ); $this->mergeForm(new FicheForm()); } } //action from Artiste controler public function executeCreate(sfWebRequest $request) { $this->forward404Unless($request->isMethod(sfRequest::POST)); $fiche = new Fiche(); $fiche->save(); $artiste = new Artiste(); $artiste->setFiche($fiche); $this->form = new ArtisteForm($artiste); $this->processForm($request, $this->form); $this->setTemplate('new'); } Thanks to you all for your help ! On 22 juin, 15:36, Tom Ptacnik wrote: > I would try instead of $artiste->setIdFiche($a); something like > $artiste->setFiche($fiche); > > On 22 čvn, 15:10, titiyoyo wrote: > > > > > Well now i get the Id. > > But basically what i did was i merged two forms (from Artiste and > > Fiche models) and tried to create a new Artiste from a form, and set > > the Fiche foreign key directly in the controler. > > > I don't have the exact code here but it looks like this below. > > > All this creates a new Fiche and a new Artiste, but it doesn't inserts > > the new Fiche id in the Artiste table. So no link is created between > > the two tables. > > Which is what it only lacks... > > > //Form for Artiste model > > class ArtisteForm extends BaseArtisteForm > > { > > public function configure() > > { > > unset( > > $this['id_fiche'] > > ); > > > $this->merge(new Fiche()); > > } > > > } > > > //controler for Artiste model > > public function executeNew(sfWebRequest $request) > > { > > $fiche = new Fiche(); > > $fiche->save(); > > $artiste = new Artiste(); > > $a = $fiche->getId(); > > > $artiste->setIdFiche($a); > > > $this->form = new ArtisteForm($artiste); > > } > > > On 21 juin, 15:06, titiyoyo wrote: > > > > Hi there > > > > thanks for that. > > > > for now i have this : > > > > public function executeNew(sfWebRequest $request) > > > { > > > $fiche = new Fiche(); > > > $fiche->save(); > > > $artiste = new Artiste(); > > > $a = $fiche->getId(); > > > > $artiste->setIdFiche($a); > > > > $this->form = new ArtisteForm($artiste); > > > } > > > > i got the needed id in $a, but when the form is saved no id is written > > > in db... > > > > On 21 juin, 09:00, Tom Ptacnik wrote: > > > > > I think that the solution might be owerwriting the doSave method .. or > > > > some method where the saving of the object is done. You need to save > > > > the foreign object first - to obtain the id from the database, then > > > > save the main object. > > > > > On 19 čvn, 12:24, titiyoyo wrote: > > > > > > Hi there, > > > > > > i'm new to symfony and am bumping into a problem here. > > > > > I merged two forms from 2 different models and need to get a foreign > > > > > key from table A to put in this table B form. > > > > > > Basically, i have to > > > > > - create a record in table A and get this record's id > > > > > - create a record in table B an set it's table_a_id to the value i > > > > > just got > > > > > - fill out the rest of the info that will be put in table B > > > > > > My question is : > > > > > how can i get the needed id ? > > > On 22 juin, 14:08, Gareth McCumskey wrote: > > > > Quite simple as the new record Id is inserted on save. If you use Propel > > > and > > > have the following for example: > > > > $obj_to_save = new ModelClass(); > > > $obj_to_save->setField1('value1'); > > > $obj_to_save->setField2('value2'); > > > $obj_to_save->save(); > > > > Then you can get the ID right after save with: > > > > $obj_to_save->getId(); //Assuming your primary key id feild is called "id" > > > > On Saturday 19 June 2010 12:24:06 titiyoyo wrote: > > > > > Hi there, > > > > > i'm new to symfony and am bumping into a problem here. > > > > I merged two forms from 2 different models and need to get a foreign > > > > key from table A to put in this table B form. > > > > > Basically, i have to > > > > - create a record in table A and get this record's id > > > > - create a record in table B an set it's table_a_id to the value i > > > > just got > > > > - fill out the rest of the info that will be put in table B > > > > > My question is : > > > > how can i get the needed 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
[symfony-users] Re: How to pass PHP values to addJavascript() (or something else) ?
hi , you could try use_dynamic_javascript. It is like an action but the view is js, so you can include php in your js template On 22 juin, 10:03, François wrote: > Hi, > > I'd like to pass values to my JS script when I call it. So I look the > API for the addJavascript() method, herre is it : > > addJavascript ($file, $position, $options) > $file The JavaScript file > $position Position > $options Javascript options > Adds javascript code to the current web response. > > I understant $file and $position but $options ? I looked on the net > and I can't see exemples with $options :/ > > I was hoping that addJavascript() works like jQuery.post() (http:// > api.jquery.com/jQuery.post/), I mean : > > $.post("test.php", { name: "John", time: "2pm" }); > > So I tried this : > > // actions.class.php > ... > public function executeSomething(sfWebRequest $request) > { > $foo = 'bar'; > $this->getResponse()->addJavascript('script.js', '', > array('foobar' > => $foo)); > } > > // script.js > > alert(foobar); // 'bar' > > And unfortunately, it doesn't work :/ > > Do you have any solutions ? 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] Re: Set form value from controler
On 21 Giu, 19:49, titiyoyo wrote: > i have a simple and basic quesion here about symfony : how can i set > values into a form field from the controller in symfony ? > > I looked again and again and again without finding an answer. > > So for now i have this below. > > Please help me, it's quite urgent !! > > public function executeNew(sfWebRequest $request) > { > $fiche = new Fiche(); > $fiche->save(); > > $a = $fiche->getId(); > > $this->form = new ArtisteForm($artiste); > } If ArtisteForm is a model form, you need to pass an object of that model (in the code you provided, you're passing a non-existent variable) cheers Massimilano -- 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] Problems in executeUpdate when trying to extend a form
Hi, I have a problem when trying to use a MyProfileForm that extends the BasesfGuardUserForm. Here it is : In sfGuardUser/action.class.php : ... public function executeMyProfile() { $this->sf_guard_user = $this->getUser()->getGuardUser(); $this->form = new MyProfileForm($this->sf_guard_user); $this->setTemplate('edit'); } ... My problem here is at the update : it loads the page with errors on the sfGuardUserForm, and not on the MyProfileForm. So I tried overriding the executeUpdate method : public function executeUpdate(sfWebRequest $request) { $this->sf_guard_user = $this->getRoute()->getObject(); $this->form = new MyProfileForm($this->sf_guard_user); $this->form->bind($request->getParameter("sf_guard_user")); if ($this->form->isValid()) { echo "valid"; exit; } else { } } At the update, symfony tells me there is already a user with the username given. I'm guessing it's trying to add a new object, while I just want an update ! I think my problem is that the method $this->configuration- >getForm($this->sf_guard_user); always gives me the sfGuardUserForm, though I pass a MyProfileForm. Anyone had this problem before ? Any solution ? Thanks a lot ! John -- 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: Change the maxperpage value for the pager
Thanks for your answer, it's exactly what i want to do, BUT i can't make it work... I have implemented the code shown on the presentation but, on diapo 22, it's about "js onchange submits to an action" and i dont really understand what it means... In fact i have done a onchange event on my select button, which calls an ajax function, which call the symfony action written on this diapo. And so, i have to manually refresh the page for the changes being applied... Can you help me to finish the job? -- 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: sfDoctrineGuardUser: Unable to stay signed in
I hadn't altered factories.yml at all. Being in there I tried changing the session_name (it was just the default 'symfony') and the site stopped exhibiting the broken behavior. This still doesn't make sense to me, but altering the session_name certainly fixed things for now. I have a few apps with the default cookie name, could that be the issue? On Tue, Jun 22, 2010 at 8:44 AM, pghoratiu wrote: > The defaults for session storage are defined in apps/frontend/config/ > factories.yml. > If there is nothing changed vs. the defaults than the PHP session > storage is used, in this case you can check > the serialized sessions stored usually somewhere in /var/lib/php5 (or > something similar, depending on your Linux distribution). > > gabriel > > > On Jun 22, 5:33 pm, ashton honnecke wrote: >> I'm not sure. How do I check on this? >> >> I tried reverting my dev instance to a known version (the same one >> that is in production and can be logged in to), it still exhibits this >> behavior, so I think that you are probably right that there is >> something going on outside of the code. What might that be, and do >> you have any ideas of how I could check? >> >> ashton > > -- > 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: sfDoctrineGuardUser: Unable to stay signed in
The defaults for session storage are defined in apps/frontend/config/ factories.yml. If there is nothing changed vs. the defaults than the PHP session storage is used, in this case you can check the serialized sessions stored usually somewhere in /var/lib/php5 (or something similar, depending on your Linux distribution). gabriel On Jun 22, 5:33 pm, ashton honnecke wrote: > I'm not sure. How do I check on this? > > I tried reverting my dev instance to a known version (the same one > that is in production and can be logged in to), it still exhibits this > behavior, so I think that you are probably right that there is > something going on outside of the code. What might that be, and do > you have any ideas of how I could check? > > ashton -- 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: sfDoctrineGuardUser: Unable to stay signed in
I'm not sure. How do I check on this? I tried reverting my dev instance to a known version (the same one that is in production and can be logged in to), it still exhibits this behavior, so I think that you are probably right that there is something going on outside of the code. What might that be, and do you have any ideas of how I could check? ashton On Tue, Jun 22, 2010 at 6:14 AM, pghoratiu wrote: > How does symfony store the session in your case, are you using the php > session or something else? > > gabriel > > On Jun 22, 9:19 am, ashton honnecke wrote: >> I am able to save information to the session manually: >> print_r($_SESSION['something']); >> $_SESSION['something'] = array('7'); >> >> That will save and then print Array ( [0] => 7 ) in a unprotected action. > > -- > 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: Get record id and set it into form
I would try instead of $artiste->setIdFiche($a); something like $artiste->setFiche($fiche); On 22 čvn, 15:10, titiyoyo wrote: > Well now i get the Id. > But basically what i did was i merged two forms (from Artiste and > Fiche models) and tried to create a new Artiste from a form, and set > the Fiche foreign key directly in the controler. > > I don't have the exact code here but it looks like this below. > > All this creates a new Fiche and a new Artiste, but it doesn't inserts > the new Fiche id in the Artiste table. So no link is created between > the two tables. > Which is what it only lacks... > > //Form for Artiste model > class ArtisteForm extends BaseArtisteForm > { > public function configure() > { > unset( > $this['id_fiche'] > ); > > $this->merge(new Fiche()); > } > > } > > //controler for Artiste model > public function executeNew(sfWebRequest $request) > { > $fiche = new Fiche(); > $fiche->save(); > $artiste = new Artiste(); > $a = $fiche->getId(); > > $artiste->setIdFiche($a); > > $this->form = new ArtisteForm($artiste); > } > > On 21 juin, 15:06, titiyoyo wrote: > > > > > > > Hi there > > > thanks for that. > > > for now i have this : > > > public function executeNew(sfWebRequest $request) > > { > > $fiche = new Fiche(); > > $fiche->save(); > > $artiste = new Artiste(); > > $a = $fiche->getId(); > > > $artiste->setIdFiche($a); > > > $this->form = new ArtisteForm($artiste); > > } > > > i got the needed id in $a, but when the form is saved no id is written > > in db... > > > On 21 juin, 09:00, Tom Ptacnik wrote: > > > > I think that the solution might be owerwriting the doSave method .. or > > > some method where the saving of the object is done. You need to save > > > the foreign object first - to obtain the id from the database, then > > > save the main object. > > > > On 19 čvn, 12:24, titiyoyo wrote: > > > > > Hi there, > > > > > i'm new to symfony and am bumping into a problem here. > > > > I merged two forms from 2 different models and need to get a foreign > > > > key from table A to put in this table B form. > > > > > Basically, i have to > > > > - create a record in table A and get this record's id > > > > - create a record in table B an set it's table_a_id to the value i > > > > just got > > > > - fill out the rest of the info that will be put in table B > > > > > My question is : > > > > how can i get the needed id ? > > On 22 juin, 14:08, Gareth McCumskey wrote: > > > Quite simple as the new record Id is inserted on save. If you use Propel and > > have the following for example: > > > $obj_to_save = new ModelClass(); > > $obj_to_save->setField1('value1'); > > $obj_to_save->setField2('value2'); > > $obj_to_save->save(); > > > Then you can get the ID right after save with: > > > $obj_to_save->getId(); //Assuming your primary key id feild is called "id" > > > On Saturday 19 June 2010 12:24:06 titiyoyo wrote: > > > > Hi there, > > > > i'm new to symfony and am bumping into a problem here. > > > I merged two forms from 2 different models and need to get a foreign > > > key from table A to put in this table B form. > > > > Basically, i have to > > > - create a record in table A and get this record's id > > > - create a record in table B an set it's table_a_id to the value i > > > just got > > > - fill out the rest of the info that will be put in table B > > > > My question is : > > > how can i get the needed 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: Inserting same form multiple entries at the same time
Let this form as it was (without loop) - let's call it basic form. Create another form (master form) and embed basic form x-times into it. http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms On 21 čvn, 23:00, "mo.mughrabi" wrote: > Hello, > I been trying all day to do multiple insert for the same form based on > a number and i couldn't go any where with it. I hope someone here > would be help me out... > > am using admin generator on 1.4 doctrine. I have a form which i > generated with only two fields. what am trying to do is, based on a > number inserted the form will be repeated x number of times. > > In the generator file I added a partial which placed a text field in > the beginning of the form with default value of 1. If I choose 2 the > form below gets duplicated twice.. > > Here is what i did to my form.. In action > > class prizesActions extends autoPrizesActions > { > public function executeNew(sfWebRequest $request) > { > > $this->form = $this->configuration->getForm(null, array('n' => > 5)); > $this->prizes = $this->form->getObject(); > > } > > } > > and in the PrizesForm, I wrote the following > > class PrizesForm extends BasePrizesForm > { > public function configure() > { > $array = $this->getOptions(); > for ($i = 0; $i < $array['n']; $i++) { > > $this->setWidgets(array( > 'id' => new sfWidgetFormInputHidden(), > 'prize_no' => new sfWidgetFormInputText(), > 'prize' => new sfWidgetFormInputText(), > 'created_at' => new sfWidgetFormDateTime(), > 'updated_at' => new sfWidgetFormDateTime(), > )); > > $this->setValidators(array( > 'id' => new sfValidatorDoctrineChoice(array('model' => > $this->getModelName(), 'column' => 'id', 'required' => false)), > 'prize_no' => new sfValidatorInteger(array('required' => > false)), > 'prize' => new sfValidatorString(array('max_length' => > 200, 'required' => false)), > 'created_at' => new sfValidatorDateTime(), > 'updated_at' => new sfValidatorDateTime(), > )); > > $this->widgetSchema->setNameFormat('prizes['.$i.'][%s]'); > > $this->errorSchema = new > sfValidatorErrorSchema($this->validatorSchema); > > } > > unset( $this['updated_at'], > $this['created_at'] > ); > } > > } > > I think the loop is working but its over writing the widgets at every > entry and i cannot find other method to append instead. Any ideas? > > 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] Re: Set form value from controler
If you mean how to set default values, then try setDefaults() http://www.symfony-project.org/api/1_4/sfForm#method_setdefaults On 21 čvn, 19:49, titiyoyo wrote: > Hi there, > > i have a simple and basic quesion here about symfony : how can i set > values into a form field from the controller in symfony ? > > I looked again and again and again without finding an answer. > > So for now i have this below. > > Please help me, it's quite urgent !! > > public function executeNew(sfWebRequest $request) > { > $fiche = new Fiche(); > $fiche->save(); > > $a = $fiche->getId(); > > $this->form = new ArtisteForm($artiste); > } -- 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: Get record id and set it into form
and this below gets the id alright. $a = $fiche->getId(); On 22 juin, 15:10, titiyoyo wrote: > Well now i get the Id. > But basically what i did was i merged two forms (from Artiste and > Fiche models) and tried to create a new Artiste from a form, and set > the Fiche foreign key directly in the controler. > > I don't have the exact code here but it looks like this below. > > All this creates a new Fiche and a new Artiste, but it doesn't inserts > the new Fiche id in the Artiste table. So no link is created between > the two tables. > Which is what it only lacks... > > //Form for Artiste model > class ArtisteForm extends BaseArtisteForm > { > public function configure() > { > unset( > $this['id_fiche'] > ); > > $this->merge(new Fiche()); > } > > } > > //controler for Artiste model > public function executeNew(sfWebRequest $request) > { > $fiche = new Fiche(); > $fiche->save(); > $artiste = new Artiste(); > $a = $fiche->getId(); > > $artiste->setIdFiche($a); > > $this->form = new ArtisteForm($artiste); > } > > On 21 juin, 15:06, titiyoyo wrote: > > > > > Hi there > > > thanks for that. > > > for now i have this : > > > public function executeNew(sfWebRequest $request) > > { > > $fiche = new Fiche(); > > $fiche->save(); > > $artiste = new Artiste(); > > $a = $fiche->getId(); > > > $artiste->setIdFiche($a); > > > $this->form = new ArtisteForm($artiste); > > } > > > i got the needed id in $a, but when the form is saved no id is written > > in db... > > > On 21 juin, 09:00, Tom Ptacnik wrote: > > > > I think that the solution might be owerwriting the doSave method .. or > > > some method where the saving of the object is done. You need to save > > > the foreign object first - to obtain the id from the database, then > > > save the main object. > > > > On 19 čvn, 12:24, titiyoyo wrote: > > > > > Hi there, > > > > > i'm new to symfony and am bumping into a problem here. > > > > I merged two forms from 2 different models and need to get a foreign > > > > key from table A to put in this table B form. > > > > > Basically, i have to > > > > - create a record in table A and get this record's id > > > > - create a record in table B an set it's table_a_id to the value i > > > > just got > > > > - fill out the rest of the info that will be put in table B > > > > > My question is : > > > > how can i get the needed id ? > > On 22 juin, 14:08, Gareth McCumskey wrote: > > > Quite simple as the new record Id is inserted on save. If you use Propel and > > have the following for example: > > > $obj_to_save = new ModelClass(); > > $obj_to_save->setField1('value1'); > > $obj_to_save->setField2('value2'); > > $obj_to_save->save(); > > > Then you can get the ID right after save with: > > > $obj_to_save->getId(); //Assuming your primary key id feild is called "id" > > > On Saturday 19 June 2010 12:24:06 titiyoyo wrote: > > > > Hi there, > > > > i'm new to symfony and am bumping into a problem here. > > > I merged two forms from 2 different models and need to get a foreign > > > key from table A to put in this table B form. > > > > Basically, i have to > > > - create a record in table A and get this record's id > > > - create a record in table B an set it's table_a_id to the value i > > > just got > > > - fill out the rest of the info that will be put in table B > > > > My question is : > > > how can i get the needed 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: Get record id and set it into form
Well now i get the Id. But basically what i did was i merged two forms (from Artiste and Fiche models) and tried to create a new Artiste from a form, and set the Fiche foreign key directly in the controler. I don't have the exact code here but it looks like this below. All this creates a new Fiche and a new Artiste, but it doesn't inserts the new Fiche id in the Artiste table. So no link is created between the two tables. Which is what it only lacks... //Form for Artiste model class ArtisteForm extends BaseArtisteForm { public function configure() { unset( $this['id_fiche'] ); $this->merge(new Fiche()); } } //controler for Artiste model public function executeNew(sfWebRequest $request) { $fiche = new Fiche(); $fiche->save(); $artiste = new Artiste(); $a = $fiche->getId(); $artiste->setIdFiche($a); $this->form = new ArtisteForm($artiste); } On 21 juin, 15:06, titiyoyo wrote: > Hi there > > thanks for that. > > for now i have this : > > public function executeNew(sfWebRequest $request) > { > $fiche = new Fiche(); > $fiche->save(); > $artiste = new Artiste(); > $a = $fiche->getId(); > > $artiste->setIdFiche($a); > > $this->form = new ArtisteForm($artiste); > } > > i got the needed id in $a, but when the form is saved no id is written > in db... > > On 21 juin, 09:00, Tom Ptacnik wrote: > > > I think that the solution might be owerwriting the doSave method .. or > > some method where the saving of the object is done. You need to save > > the foreign object first - to obtain the id from the database, then > > save the main object. > > > On 19 čvn, 12:24, titiyoyo wrote: > > > > Hi there, > > > > i'm new to symfony and am bumping into a problem here. > > > I merged two forms from 2 different models and need to get a foreign > > > key from table A to put in this table B form. > > > > Basically, i have to > > > - create a record in table A and get this record's id > > > - create a record in table B an set it's table_a_id to the value i > > > just got > > > - fill out the rest of the info that will be put in table B > > > > My question is : > > > how can i get the needed id ? On 22 juin, 14:08, Gareth McCumskey wrote: > Quite simple as the new record Id is inserted on save. If you use Propel and > have the following for example: > > $obj_to_save = new ModelClass(); > $obj_to_save->setField1('value1'); > $obj_to_save->setField2('value2'); > $obj_to_save->save(); > > Then you can get the ID right after save with: > > $obj_to_save->getId(); //Assuming your primary key id feild is called "id" > > On Saturday 19 June 2010 12:24:06 titiyoyo wrote: > > > Hi there, > > > i'm new to symfony and am bumping into a problem here. > > I merged two forms from 2 different models and need to get a foreign > > key from table A to put in this table B form. > > > Basically, i have to > > - create a record in table A and get this record's id > > - create a record in table B an set it's table_a_id to the value i > > just got > > - fill out the rest of the info that will be put in table B > > > My question is : > > how can i get the needed 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] Removing a cached template fragment does not work (sf 1.4)
On Mon, 21 Jun 2010, Matthias N. wrote: > So.. the problem is I try to remove that fragment using the view cache > manager but it doesn't work. > I tried this but it does not work because it generates not the > appropriate filename/pattern: > > $cacheManager->remove('@sf_cache_partial? > module=*&action=show&sf_cache_key='.$myCacheKey); > > This generates the following file name: > > my-domain/all/sf_cache_partial/*/show/sf_cache_key/foo/bar/baz/slug/ > home.cache I would use clearGlob() instead. -- -- 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] Abridged summary of symfony-users@googlegroups.com - 36 Messages in 16 Topics
Beste, Tot en met 27 juni ben ik niet aanwezig op kantoor. U kunt voor dringende zaken contact opnemen met Wout Withagen: w...@freshheads.com of 013 5448761. Met vriendelijke groet, Joost Farla joost.fa...@freshheads.com - - freshheads grafisch ontwerp en internet applicaties Dunantstraat 1c | 5017 KC Tilburg | Nederland tel. +31 (0)13 5448761 | fax. +31 (0)13 5448762 i...@freshheads.com | www.freshheads.com -- 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] Smarty and Symfony
On Tue, 22 Jun 2010, Dan Harabagiu wrote: > I have a site written using Smarty, is there anyway I can migrate it to > symfony? or at least develop additional features using symfony? There is an sfsmarty plugin, so its possible to use Smarty with symfony. -- -- 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] Smarty and Symfony
Hy symfony users, I have a site written using Smarty, is there anyway I can migrate it to symfony? or at least develop additional features using symfony? Dan. -- 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: sfDoctrineGuardUser: Unable to stay signed in
How does symfony store the session in your case, are you using the php session or something else? gabriel On Jun 22, 9:19 am, ashton honnecke wrote: > I am able to save information to the session manually: > print_r($_SESSION['something']); > $_SESSION['something'] = array('7'); > > That will save and then print Array ( [0] => 7 ) in a unprotected action. -- 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] Get record id and set it into form
Quite simple as the new record Id is inserted on save. If you use Propel and have the following for example: $obj_to_save = new ModelClass(); $obj_to_save->setField1('value1'); $obj_to_save->setField2('value2'); $obj_to_save->save(); Then you can get the ID right after save with: $obj_to_save->getId(); //Assuming your primary key id feild is called "id" On Saturday 19 June 2010 12:24:06 titiyoyo wrote: > Hi there, > > i'm new to symfony and am bumping into a problem here. > I merged two forms from 2 different models and need to get a foreign > key from table A to put in this table B form. > > Basically, i have to > - create a record in table A and get this record's id > - create a record in table B an set it's table_a_id to the value i > just got > - fill out the rest of the info that will be put in table B > > My question is : > how can i get the needed 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] Load partial with ajax problem
Hi I made this JavaScript function to load a partial. function renderPartial(partial, div, params){ $('.loader').show(); $(div).load( partial, params, //params = { var1 : 2, var2 : 1 } function() {$('.loader').hide();} ); } When i call it everything works, but in my action, the params i get are coming: sfParameterHolder Object ( [parameters:protected] => Array ( [{var1_:_2,_var2_:_1}] => [module] => myModule [action] => show [sf_format] => html [id] => 2 ) ) I can't access to the params i passed by Ajax, they come protected(?) Any idea what is wrong? -- 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: Change the maxperpage value for the pager
just found that presentation: http://www.slideshare.net/jcleveley/working-with-the-admin-generator slide: 22-23 : Dynamic MaxPerPage that should help -- 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 pass PHP values to addJavascript() (or something else) ?
Hi, I'd like to pass values to my JS script when I call it. So I look the API for the addJavascript() method, herre is it : addJavascript ($file, $position, $options) $file The JavaScript file $position Position $optionsJavascript options Adds javascript code to the current web response. I understant $file and $position but $options ? I looked on the net and I can't see exemples with $options :/ I was hoping that addJavascript() works like jQuery.post() (http:// api.jquery.com/jQuery.post/), I mean : $.post("test.php", { name: "John", time: "2pm" }); So I tried this : // actions.class.php ... public function executeSomething(sfWebRequest $request) { $foo = 'bar'; $this->getResponse()->addJavascript('script.js', '', array('foobar' => $foo)); } // script.js alert(foobar); // 'bar' And unfortunately, it doesn't work :/ Do you have any solutions ? 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] Re: Get record id and set it into form
Does your form has input (hidden) for this id? Show your form code. (setup, configure, ...) On 21 čvn, 15:06, titiyoyo wrote: > Hi there > > thanks for that. > > for now i have this : > > public function executeNew(sfWebRequest $request) > { > $fiche = new Fiche(); > $fiche->save(); > $artiste = new Artiste(); > $a = $fiche->getId(); > > $artiste->setIdFiche($a); > > $this->form = new ArtisteForm($artiste); > } > > i got the needed id in $a, but when the form is saved no id is written > in db... > > On 21 juin, 09:00, Tom Ptacnik wrote: > > > > > I think that the solution might be owerwriting the doSave method .. or > > some method where the saving of the object is done. You need to save > > the foreign object first - to obtain the id from the database, then > > save the main object. > > > On 19 čvn, 12:24, titiyoyo wrote: > > > > Hi there, > > > > i'm new to symfony and am bumping into a problem here. > > > I merged two forms from 2 different models and need to get a foreign > > > key from table A to put in this table B form. > > > > Basically, i have to > > > - create a record in table A and get this record's id > > > - create a record in table B an set it's table_a_id to the value i > > > just got > > > - fill out the rest of the info that will be put in table B > > > > My question is : > > > how can i get the needed 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: sfDoctrineGuardUser: Unable to stay signed in
I am able to save information to the session manually: print_r($_SESSION['something']); $_SESSION['something'] = array('7'); That will save and then print Array ( [0] => 7 ) in a unprotected action. On Mon, Jun 21, 2010 at 12:14 PM, pghoratiu wrote: > I would say it's something wrong at the PHP configuration level, what > is your environment (OS, PHP, symfony version, ...?). > > gabriel > > On Jun 21, 8:51 pm, ashton honnecke wrote: >> This is what I have in configuration>user on the page load after sign >> in (from the webDebugToolbar): >> >> attributeHolder: >> sfGuardSecurityUser: { user_id: '173' } >> >> On the next pageload, it goes away (no sfGuardSecurityUser at all) >> >> I printed the session at the beginning of an action (right after >> login) and I got: >> [sfGuardSecurityUser] => Array >> ( >> [user_id] => 173 >> ) >> >> then died before the action was over. >> >> Reloading after that got me back to the signin page. >> >> I did recently add Profile to the schema (with a 1:1 relationship >> between User and Profile) and rebuild after that. >> >> I tried removing and re-adding the entire plugin with no change in behavior. >> >> >> >> On Fri, Jun 18, 2010 at 12:57 AM, pghoratiu wrote: >> > Check the session - the user id should be stored after sign-in. >> > This can be checked in the web debug toolbar or directly the >> > serialized session data. >> >> > gabriel >> >> > On Jun 18, 9:50 am, ashton wrote: >> >> I'm not sure how I broke things, but I can no longer remain logged in >> >> beyond one page load (tried clearing cache/using a different browser). >> >> >> * When I hit a page, I get the login screen >> >> * I login successfully >> >> * The page that I was initially navigating to loads >> >> * Then next time that I load a page, the signinSuccess form renders >> >> again. >> >> >> Thoughs? >> >> >> logs:http://pastebin.com/0302jtfK >> >> > -- >> > 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