[symfony-users] Re: Problems with a select to change the language (cookies)
Why do you need to delete cookies before? On 28 čnc, 20:47, Javier Garcia tirengar...@gmail.com wrote: Hi I have followed the steps below to add a select to change the language of my app. http://www.symfony-project.org/jobeet/1_4/Doctrine/en/19#chapter_19_l... It works OK for the first time I change the language, but the next time I try to change it I need to delete the Cookies before.. I tried it in FF and Epiphany and is the same problem in both. Any idea? Javi Sf 1.3 / Ubuntu 8.04 -- 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: how to use Flush wih symfony
Ok, I think I understand. You are showing some page - the loading of the page is slow because of the work on the background (rebuilding the lucene index) If I'm right, then the solution would be to show some javascript progressbar and do the rebuilding in ajax request. Or (if you are rebuilding the index by yourself), then you can write to the database that you started rebuilding the index. Then on the page periodically check (probably by ajax request) if the index rebuilding is still in action. Then after the rebuilding is done ... write to the database rebuilding=false ... The page then will recognize that its over... On 28 čnc, 22:52, Julian Reyes Escrigas julian.reyes.escri...@gmail.com wrote: I'm trying to make a task in the backend for re-build the lucene's index but the index grows with the time and is more slower to rebuild in the future, and trying to make an action form rebuild the index and notice to user the progress of the operation, I need send to the browser information like the progress, Example: While (true) { updateIndex(); send( 'progress');} Send (''task ended); sorry for my grammar, I dont speak well the English -Mensaje original- De: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] En nombre de Tom Ptacnik Enviado el: miércoles, 28 de julio de 2010 1:13 Para: symfony users Asunto: [symfony-users] Re: how to use Flush wih symfony I don't understand what are you trying to achieve.Try to explain again. On 25 čnc, 20:12, Julian Reyes Escrigas julian.reyes.escri...@gmail.com wrote: How to use flush with symfony in a long while for send information to user -- 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] Re: Avoid blank embed form to be saved
I think that easy solution is to overwrite the save method of the object wich is on the embeded form. Just test if there are some values and if not, end the method. If yes, call parent::save() On 30 čnc, 01:51, J_Wesker j_chave...@hotmail.com wrote: After making some changes on my code and debugging using die's and var_dump() all day, I haven't found the cause of all this. But I have make sure of some facts: 1. If I embed directly the comment form, and set the body field as required, then both objects get saved smoothly, unfortunately the bussiness rules I'm following here don't apply. 2. On my extended saveEmbeddedForms() method, $comment is actually NULL, because on the custom post validator, if no body comment is entered, the comment value is unset. Therefore, the condition we discussed before complies correctly when necessary. 3. Even though the values from the embedded form aren't set, the comment form is saved anyway if left blank. I came to the point to think that perhaps the relation between the comment and user table might be the cause, and then I decided to remove the relation from the comment table, but still, the embed form is saved blank. If not removing the relationship and with the following updated code, I get a Propel Exception only when the comment is left blank. http://pastie.org/1066339 / model http://pastie.org/1066347 / ExpenseForm http://pastie.org/1066350 / ExpenseCommentValidatorSchema http://pastie.org/1066353 / ExpenseCommentForm http://pastie.org/1066364 / PropelException generated UPDATE!!! While writing this post I made a breaktrhough with this, but even so, I'm still missing something... If instead of defining the relationship between Expense and Comment objects in the ExpenseForm like this: $comment-setExpense($this-getObject()); to this: $comment-setExpenseId($this-getObject()-getId()); when editing an existing expense, comments are saved correctly, and most important no blank comment is saved! There is a big BUT, however, the expense object doesn't get an ID until after saving the embeded objects, so, how can I approach this for new expense forms??? Apparently the problem is about how Propel saves embedded objects, because as a direct object relation was made with $comment-setExpense(), the saving of the embed object is forced, even if the embed form is deleted S Any ideas on how to solve this? I will try to analyze more the flow used in sfFormObject::save() method tomorrow, and perhaps extending some of the method calls used by save() I will find the answer. If someone has any suggestion or idea please let me know :) Best regards! -- 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] Timestampable
Hi! I use the Timestampable behavior on a model. The model counts how often it was shown at a column views. Well as you might imagin, I want to update the views-column without changing the updated_at-value. How can I do this? example: public function incrementNbViews() { $invoker = $this-getInvoker(); // increment $invoker-setNbViews($invoker-getNbViews() + 1); // save $q = Doctrine::getTable(get_class($invoker))-createQuery(); $q-update() -set($q-getRootAlias().'.nb_views', '?', $invoker-getNbViews()) -where($q-getRootAlias().'.id = ?', $invoker-getId()) -execute(); } = updated_at should NOT change, but it does. -- 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: include_js/css VS partials
If I would use only one css-file, I wouldn't be able to flexibly change things later. I solved it this way: The layout explicitly includes all css/js in the head which are needed from partials that are included in the the layout. The good thing about the js/css-helper is, that it will only include a css/js once. Thanks! On Jul 29, 3:11 pm, Massimiliano Arione garak...@gmail.com wrote: On 17 Lug, 20:15, comb sa...@gmx.net wrote: I found much on the web regarding the topic, but no solution! :( Normally one would include the css and js in the head. But if I call ?php use_javascript('xyz.js'); php use_stylesheet('xyz.css') ? from an partial, they are not included, because the helpers in the head of the layout are executed already. Putting the helpers to the bottom of the layout includes ALL, but this fails caused by html-standards. How can I manage to include the js/css needed from partials in the head of the html-document, too? You should use just one css file (for performance issues). Also for performances, you should move include_javascripts from head to body, just in the end. cheers Massimiliano -- 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: Problems with a select to change the language (cookies)
As I say in my first post, the second time I try to change the language doesn't work if I don't delete the cookies. These are my steps: - Load the page - Change the language OK. - I try to change the language again but it doesn't work. - I delete the cookies. - I try to change the language again and it works OK. On 07/30/2010 09:03 AM, Tom Ptacnik wrote: Why do you need to delete cookies before? On 28 čnc, 20:47, Javier Garciatirengar...@gmail.com wrote: Hi I have followed the steps below to add a select to change the language of my app. http://www.symfony-project.org/jobeet/1_4/Doctrine/en/19#chapter_19_l... It works OK for the first time I change the language, but the next time I try to change it I need to delete the Cookies before.. I tried it in FF and Epiphany and is the same problem in both. Any idea? Javi Sf 1.3 / Ubuntu 8.04 -- 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: Problems with a select to change the language (cookies)
javi, This is the extract from sfUser.class.php, Line:103 $this-setCulture(null !== $this-options['culture'] ? $this-options['culture'] : (null !== $currentCulture ? $currentCulture : $this-options['default_culture'])); So the culture of the user will be decided by the following order: 1. sf_culture parameter from url 2. culture value in session 3. default value set in setting.xml Hope that will help. travis On Fri, Jul 30, 2010 at 6:11 PM, Javier Garcia tirengar...@gmail.comwrote: As I say in my first post, the second time I try to change the language doesn't work if I don't delete the cookies. These are my steps: - Load the page - Change the language OK. - I try to change the language again but it doesn't work. - I delete the cookies. - I try to change the language again and it works OK. On 07/30/2010 09:03 AM, Tom Ptacnik wrote: Why do you need to delete cookies before? On 28 čnc, 20:47, Javier Garciatirengar...@gmail.com wrote: Hi I have followed the steps below to add a select to change the language of my app. http://www.symfony-project.org/jobeet/1_4/Doctrine/en/19#chapter_19_l... It works OK for the first time I change the language, but the next time I try to change it I need to delete the Cookies before.. I tried it in FF and Epiphany and is the same problem in both. Any idea? Javi Sf 1.3 / Ubuntu 8.04 -- 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.comsymfony-users%2bunsubscr...@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] Re: sfUser::setFlash doesn't work in Chrome?
Ok. I'll try it on another PC. Thanks. travis On Fri, Jul 30, 2010 at 4:44 PM, Tom Ptacnik to...@tomor.cz wrote: flash works ok in my chrome browser (tested in classic admin generated backend where flash is used after the item is deleted in the list) On 29 čnc, 15:20, Travis lyf...@gmail.com wrote: Yes. The cookie is set. And as you can see, the setAttribute and getAttribute method work cookies enabled? On Jul 29, 9:08 am, travis lyf...@gmail.com wrote: Hi all, I just found some functions have problems in my Chrome browser. It took me some time to find out the problem is caused by the setFlash method in sfUser. It seems it can't work properly in Chrome. Here is how I test the function: I created two actions: The first one can be visisted by /test/set, it is used to set the attribute and flash of the current user: public function executeSet() { $t = time(); $this-getUser()-setAttribute('a', $t); $this-getUser()-setFlash('f', $t); echo The Attribute is set to : $t/br ; echo The Flash is set to : $t/br ; die(); } Another one can be visited by /test/get, it is used to get the values set by previous one: public function executeGet() { $a= $this-getUser()-getAttribute('a'); $f = $this-getUser()-getFlash('f'); echo The Attribute is : $a/br ; echo The Flash is : $f/br ; die(); } So I can first visit the first one action, and then visit another, and compare the value to check the result. Here are the test result I got (tested in FF, Safari, IE and Chrome) 1. FF (3.5.11) /test/set: The Attribute is set to : 1280386366 The Flash is set to : 1280386366 /test/get: The Attribute is : 1280386366 The Flash is : 1280386366 2. Safari (5.0) /test/set: The Attribute is set to : 1280386435 The Flash is set to : 1280386435 /test/get: The Attribute is : 1280386435 The Flash is : 1280386435 3. IE (7.0.5730.11) /test/set: The Attribute is set to : 1280386599 The Flash is set to : 1280386599 /test/get: The Attribute is : 1280386599 The Flash is : 1280386599 4. Chrome (5.0.375.125) /test/set: The Attribute is set to : 1280386677 The Flash is set to : 1280386677 /test/get: The Attribute is : 1280386677 The Flash is : As you can see, the flash value is missing here in Chrome. This is really strange since this problem seems have nothing to do with what kind of browser I used. More frastrucated is I checked the session file after visiting the / test/set, for Chrome, it is: symfony/user/sfUser/lastRequest|i:1280386998;symfony/user/sfUser/ authenticated|b:0;symfony/user/sfUser/credentials|a:0:{}symfony/user/ sfUser/attributes|a:3:{s:30:symfony/user/sfUser/attributes;a:1:{s: 1:a;i:1280386997;}s:25:symfony/user/sfUser/flash;a:0:{}s: 32:symfony/user/sfUser/flash/remove;a:0:{}}symfony/user/sfUser/ culture|s:2:en; And for the other ones: symfony/user/sfUser/lastRequest|i:1280387018;symfony/user/sfUser/ authenticated|b:0;symfony/user/sfUser/credentials|a:0:{}symfony/user/ sfUser/attributes|a:2:{s:30:symfony/user/sfUser/attributes;a:1:{s: 1:a;i:1280387018;}s:25:symfony/user/sfUser/flash;a:1:{s:1:f;i: 1280387018;}}symfony/user/sfUser/culture|s:2:en; I'm not sure anything could cause this? Do you have met this problem? Or it is just something wrong with my computer? The symfony version is 1.4.6. The application is running on Windows XP SP2 with WAMP. travis -- 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.comsymfony-users%2bunsubscr...@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: permissions checker - where to test, where to put method?
I already do something like that... I think. My solution: to create a subclass of the symfony class sfActions (in my case ssActions, placed in the lib folder). This subclass contains the preExecute method with the authentication routines. After that, every sfAction subclass must inherits from ssActions. That way, you can use $this-getUser() to get information you need to do your checks and avoid to duplicate your code in every action of your app. Hope it 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] Re: Inconsistent syntax errors in cache files
Can you upload the generated files, using pastebin or a gist on github? On Jul 29, 6:07 pm, Jonotron jonot...@gmail.com wrote: I've just started playing with Symfony 1.4.6 (after having worked with 1.0 many moons ago) and I am having a significant problem with the generated cache files. It seems as though they are not being generated correctly but in an inconsistent manner. I will get syntax errors in a few cache files that will eventually disappear if I cache:clear and reload the page enough times (sometimes requiring 5-6 cache clears). The syntax errors are inconsistent but usually: unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php unexpected $end in /myproject/cache/frontend/dev/config/ config_factories.yml.php I also get the error on the command line when I try a doctrine:build- model. It gets to the resetting application autoloaders step then gives me an unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php. This error disappears if I try doctrine:build-model enough times. I am running Ubuntu 10.04, Apache 2.2.14, PHP 5.3.2 with APC (above errors appear with APC on or off) and Symfony 1.4.6 (installed from tar.gz) Any ideas what is going on? It's putting a bad taste in my mouth and quite frustrating to work this way. -- 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] Inconsistent syntax errors in cache files
I had a similar issue once. I am not sure what exactly it was, but I think it was two errors playing together. Symfony tries to chmod/umask the cache file after it is written, and I have a virtual linux server accessing the data on a windows share which does not allow chmod. So an error occured after the first cache file was written, but I didn't see the error message because I had the sfErrorNotifier plugin in this env, and it was not configured yet. And after each start only the next cache file was written, so eventually after some tries it worked normally, because in the end all cache files were written. Try to comment out the lines 365 and 366 (chmod, umask) in lib/vendor/symfony/lib/config/sfConfigCache.class.php, this helped in my case. HTH Georg Am 29.07.2010 18:07, schrieb Jonotron: I've just started playing with Symfony 1.4.6 (after having worked with 1.0 many moons ago) and I am having a significant problem with the generated cache files. It seems as though they are not being generated correctly but in an inconsistent manner. I will get syntax errors in a few cache files that will eventually disappear if I cache:clear and reload the page enough times (sometimes requiring 5-6 cache clears). The syntax errors are inconsistent but usually: unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php unexpected $end in /myproject/cache/frontend/dev/config/ config_factories.yml.php I also get the error on the command line when I try a doctrine:build- model. It gets to the resetting application autoloaders step then gives me an unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php. This error disappears if I try doctrine:build-model enough times. I am running Ubuntu 10.04, Apache 2.2.14, PHP 5.3.2 with APC (above errors appear with APC on or off) and Symfony 1.4.6 (installed from tar.gz) Any ideas what is going on? It's putting a bad taste in my mouth and quite frustrating to work this way. -- 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 value of a database field depending of another field
If you are using Propel do it on the model inside the save() action On 29 jul, 09:50, Jérémie jeremie.symf...@gmail.com wrote: Hi all, Let me explain: I have a field isPublished in my table, and another publicationDate. When isPublished is updated from 0 to 1, I'd like to update publicationDate with the current date time. Is there a way to specify this in the schema.yml file? Thanks a lot Jérémie -- 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: Timestampable
If you don't need to auto update this field then you should not use timestampable.. Try to set the update_at field inside your update sentence to updated_at = $invoker-getUpdateAt() On 30 jul, 04:18, comb sa...@gmx.net wrote: Hi! I use the Timestampable behavior on a model. The model counts how often it was shown at a column views. Well as you might imagin, I want to update the views-column without changing the updated_at-value. How can I do this? example: public function incrementNbViews() { $invoker = $this-getInvoker(); // increment $invoker-setNbViews($invoker-getNbViews() + 1); // save $q = Doctrine::getTable(get_class($invoker))-createQuery(); $q-update() -set($q-getRootAlias().'.nb_views', '?', $invoker-getNbViews()) -where($q-getRootAlias().'.id = ?', $invoker-getId()) -execute(); } = updated_at should NOT change, but it does. -- 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: Problems with a select to change the language (cookies)
Well I have created a new symfony project and I have no problems. On 07/30/2010 12:37 PM, travis lu wrote: javi, This is the extract from sfUser.class.php, Line:103 $this-setCulture(null !== $this-options['culture'] ? $this-options['culture'] : (null !== $currentCulture ? $currentCulture : $this-options['default_culture'])); So the culture of the user will be decided by the following order: 1. sf_culture parameter from url 2. culture value in session 3. default value set in setting.xml Hope that will help. travis On Fri, Jul 30, 2010 at 6:11 PM, Javier Garcia tirengar...@gmail.com mailto:tirengar...@gmail.com wrote: As I say in my first post, the second time I try to change the language doesn't work if I don't delete the cookies. These are my steps: - Load the page - Change the language OK. - I try to change the language again but it doesn't work. - I delete the cookies. - I try to change the language again and it works OK. On 07/30/2010 09:03 AM, Tom Ptacnik wrote: Why do you need to delete cookies before? On 28 čnc, 20:47, Javier Garciatirengar...@gmail.com mailto:tirengar...@gmail.com wrote: Hi I have followed the steps below to add a select to change the language of my app. http://www.symfony-project.org/jobeet/1_4/Doctrine/en/19#chapter_19_l... It works OK for the first time I change the language, but the next time I try to change it I need to delete the Cookies before.. I tried it in FF and Epiphany and is the same problem in both. Any idea? Javi Sf 1.3 / Ubuntu 8.04 -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com http://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 mailto:symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com mailto:symfony-users%2bunsubscr...@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] How to turn off filters in admin generator?
Hi all I've discovered a bug in the filters section of the admin generator (when run against Oracle anyway) on Symfony 1.3 and Propel 1.5. I believe that if I can turn the filters off, the problem will go away. I have tried the following in a child generator.yml (i.e. a module level one that customises the parent version in a plugin). generator: param: config: filter: class: false I've also tried: generator: param: config: filter: display: [] Neither appears to have any affect. I have also added a _filters.php file in the appropriate app-level module templates folder, in order to prevent the filters rendering, and it has had no effect. Any help that can be provided will be appreciated :o) -- 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 1.4] How to deploy on a subdirectory?
Hi all, This is a topic I've been avoiding for a long time but now I need to deploy my app on a subdirectory and there's no other option. IMPORTANTE: It's on a SHARED HOSTING. The app dir structure now is something like this: / /demos /myAppSymfonyFiles /app /cache /config /data /lib /plugins /public_html /demos /myDemoApp So, the public dir, as you may guessed, is public_html. Under /demos/myDemoApp I have the contents of the web dir of Symfony. on myAppSymfonyFiles I've put the other Symfony dirs so they're private. I've changed successfully the webDir from projectConfiguration.class.php and I've changed the path to this file on the front controller as well. Everything works EXCEPT.. that it looks for every asset on the MAIN domain like: *www.mainDomain.com/css/style.css* When it should be.. *www.mainDomain.com/demos/myDemoApp/css/style.css I tried to change the .htaccess from RewriteBase / to RewriteBase /demos/myDemoApp with no success.* Anyone knows what I'm missing? 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: latest verion of sfForkedDoctrineApplyPlugin is broken
Tristan, You don't have the relation already defined, do you? But you're probably using sfDoctrineGuard 5.0.0, right? redeclare id field in your schema.yml, or use for_sfDoctrineGuard5 branch from repo. On 29 Lip, 22:04, Tristan tristan.bessou...@gmail.com wrote: Ok, it seems that i have two declaration of sfGuardUserProfile, so i deleted mine, and kept the one from the plugin (merging my attributes) SQLSTATE[HY000]: General error: 1005 Can't create table 'mywebsite.#sql-7d_7b' (errno: 150). Failing Query: ALTER TABLE sf_guard_user_profile ADD CONSTRAINT sf_guard_user_profile_user_id_sf_guard_user_id FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE. Failing Query: ALTER TABLE sf_guard_user_profile ADD CONSTRAINT sf_guard_user_profile_user_id_sf_guard_user_id FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE -- 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: Avoid blank embed form to be saved
Great suggestion! I actually found the answer yesterday... although I'm not sure if it's good practice, I just had to add an else condition in my saveEmbeddedForms() method to set the relationship with the main object, instead of forcing the relationship from the beginning. This is the updated code: http://pastie.org/1066339 / model http://pastie.org/1067543 / ExpenseForm http://pastie.org/1066350 / ExpenseCommentValidatorSchema http://pastie.org/1066353 / ExpenseCommentForm Thanks to this, the embed form is saved only if comment body is types, otherwise, the embed form is unset and ignored for the saveEmbeddedForms parent method. Thanks guys for any other ideas on how to improve this code! On Jul 30, 2:35 am, Tom Ptacnik to...@tomor.cz wrote: I think that easy solution is to overwrite the save method of the object wich is on the embededform. Just test if there are some values and if not, end the method. If yes, call parent::save() On 30 čnc, 01:51, J_Wesker j_chave...@hotmail.com wrote: After making some changes on my code and debugging using die's and var_dump() all day, I haven't found the cause of all this. But I have make sure of some facts: 1. If Iembeddirectly the commentform, and set the body field as required, then both objects get saved smoothly, unfortunately the bussiness rules I'm following here don't apply. 2. On my extended saveEmbeddedForms() method, $comment is actually NULL, because on the custom post validator, if no body comment is entered, the comment value is unset. Therefore, the condition we discussed before complies correctly when necessary. 3. Even though the values from the embeddedformaren't set, the commentformis saved anyway if left blank. I came to the point to think that perhaps the relation between the comment and user table might be the cause, and then I decided to remove the relation from the comment table, but still, theembedformis saved blank. If not removing the relationship and with the following updated code, I get a Propel Exception only when the comment is left blank. http://pastie.org/1066339 / model http://pastie.org/1066347 / ExpenseForm http://pastie.org/1066350 / ExpenseCommentValidatorSchema http://pastie.org/1066353 / ExpenseCommentForm http://pastie.org/1066364 / PropelException generated UPDATE!!! While writing this post I made a breaktrhough with this, but even so, I'm still missing something... If instead of defining the relationship between Expense and Comment objects in the ExpenseForm like this: $comment-setExpense($this-getObject()); to this: $comment-setExpenseId($this-getObject()-getId()); when editing an existing expense, comments are saved correctly, and most important no blank comment is saved! There is a big BUT, however, the expense object doesn't get an ID until after saving the embeded objects, so, how can I approach this for new expense forms??? Apparently the problem is about how Propel saves embedded objects, because as a direct object relation was made with $comment-setExpense(), the saving of theembedobject is forced, even if theembedformis deleted S Any ideas on how to solve this? I will try to analyze more the flow used in sfFormObject::save() method tomorrow, and perhaps extending some of the method calls used by save() I will find the answer. If someone has any suggestion or idea please let me know :) Best regards! -- 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: Sluggable behaviour: field called slug is not created
I created this ticket: http://trac.symfony-project.org/ticket/8922#preview Javi On Jul 28, 10:06 pm, Javier Garcia tirengar...@gmail.com wrote: Thanks, but it didn't work. On 07/28/2010 09:20 PM, John Kary wrote: This probably won't work, but try explicitly defining a different field name for the slug using the name option: Usuario: actAs: Sluggable: unique: true fields: [nombre_apellidos] canUpdate: true name: 'myslug' On Jul 27, 10:57 am,JavierGarciatirengar...@gmail.com wrote: On Jul 20, 12:00 pm, Tom Ptacnikto...@tomor.cz wrote: Maybe colision with inheritance? Try to move inheritance before actAs (only guess) Yes there is a colision with inheritance. When i remove the inheritance it works ok. I changed the position of inheritance but the field slug doesn't appear.. Any other idea or should i consider this is a bug? Javi -- 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: Inconsistent syntax errors in cache files
I tried commenting out the chmod and umask calls as suggested, but it did not appear to resolve the issue. Current error message: Parse error: syntax error, unexpected $end in / myproject/cache/frontend/dev/config/config_routing.yml.php on line 14 gist: http://gist.github.com/501193 doing a clear cache, I then get the same error but on the config_autoload.yml.php (which when parsed by php on command line does not give a syntax error) doing a clear cache again, I then get the same error for the config_factories.yml.php file ... actually it seems as though I don't have to do a clear cache, I can just refresh the page and the next error comes up or the page starts working. On Jul 30, 5:20 am, Georg geor...@have2.com wrote: I had a similar issue once. I am not sure what exactly it was, but I think it was two errors playing together. Symfony tries to chmod/umask the cache file after it is written, and I have a virtual linux server accessing the data on a windows share which does not allow chmod. So an error occured after the first cache file was written, but I didn't see the error message because I had the sfErrorNotifier plugin in this env, and it was not configured yet. And after each start only the next cache file was written, so eventually after some tries it worked normally, because in the end all cache files were written. Try to comment out the lines 365 and 366 (chmod, umask) in lib/vendor/symfony/lib/config/sfConfigCache.class.php, this helped in my case. HTH Georg Am 29.07.2010 18:07, schrieb Jonotron: I've just started playing with Symfony 1.4.6 (after having worked with 1.0 many moons ago) and I am having a significant problem with the generated cache files. It seems as though they are not being generated correctly but in an inconsistent manner. I will get syntax errors in a few cache files that will eventually disappear if I cache:clear and reload the page enough times (sometimes requiring 5-6 cache clears). The syntax errors are inconsistent but usually: unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php unexpected $end in /myproject/cache/frontend/dev/config/ config_factories.yml.php I also get the error on the command line when I try a doctrine:build- model. It gets to the resetting application autoloaders step then gives me an unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php. This error disappears if I try doctrine:build-model enough times. I am running Ubuntu 10.04, Apache 2.2.14, PHP 5.3.2 with APC (above errors appear with APC on or off) and Symfony 1.4.6 (installed from tar.gz) Any ideas what is going on? It's putting a bad taste in my mouth and quite frustrating to work this way. -- 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: How to turn off filters in admin generator?
Hello I am not sure whether this is any help at all but on symfony 1.4.6 with doctrine and mysql and without any extra plugins (so pretty far from your configuration...) creating an empty _filters.php in the template folder of the module works fine - no filters are displayed. Setting the display property to an empty array does not work because in sfModelGeneratorConfiguration::getFormFilterFields (see http://trac.symfony-project.org/browser/branches/1.4/lib/generator/sfModelGeneratorConfiguration.class.php#L297) there is an if condition which filters out empty arrays. Good luck Claudia On Jul 30, 6:09 pm, halfer google.com.20080213...@jondh.me.uk wrote: Hi all I've discovered a bug in the filters section of the admin generator (when run against Oracle anyway) on Symfony 1.3 and Propel 1.5. I believe that if I can turn the filters off, the problem will go away. I have tried the following in a child generator.yml (i.e. a module level one that customises the parent version in a plugin). generator: param: config: filter: class: false I've also tried: generator: param: config: filter: display: [] Neither appears to have any affect. I have also added a _filters.php file in the appropriate app-level module templates folder, in order to prevent the filters rendering, and it has had no effect. Any help that can be provided will be appreciated :o) -- 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 Almost Live: building a new Symfony application in 26 minutes
Last week I built a Symfony application while waiting for a panel discussion on web frameworks to start, then used it to demonstrate one of Symfony's advantages: speed of development. Afterwards I put together a screencast. You can watch me build the app here: http://window.punkave.com/2010/07/30/symfony-almost-live/ I've kept in my mistakes along with their solutions. More educational that way. Hope you find it helpful! Definitely a good choice for beginning Symfony developers. -- Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.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
[symfony-users] Symfony2: Best way to override format in a view
I've been experimenting with using Symfony2 for a simple rest API. The rest API is available in multiple formats (xml, json). Which format is delivered is controlled by the _format parameter. Most API calls return simple arrays (encoded in json or xml) so thus far I've skipped Symfony2's view layer, outputting the response directly from the controller using createResponse. Today I needed to include a snippet of HTML within the XML or JSON output. I wrote this HTML snippet in a PHP template and want to include it via Symfony2 views. I can't figure out how to override the format parameter so I can grab my html view, then encode it as appropriate in the controller. To be clear, my end response will still be in XML or JSON. I'd like to do something like this: // Controller: $ary = array( 'id' = $content-getId(), 'data' = $this-renderView('ApiBundle:Api:dataview', array('content' = $content) ); return $this-renderResponse($ary); In the above code, renderResponse is my own method that converts to JSON or XML based on the format. But because format is set, renderView wants a template called dataview.xml.php or dataview.json.php. Remember, I actually want to load an HTML template here. It'd be nice if I could say: $this-renderView('ApiBundle:Api:dataview', array('content'=$content), 'html'); // Override format Any thoughts? -- 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: Inconsistent syntax errors in cache files
Thinking more about what Georg said (as my setup is an Ubuntu VM in VMWare fusion 3 on my iMac with my source files shared to the box using VMWare's folder sharing functionality) I believe this is a problem with VMWare's file sharing mechanism. The problem seems to have disappeared when I moved the project file on to my VMWare guest filesystem directly. On Jul 30, 12:58 pm, Jonotron jonot...@gmail.com wrote: I tried commenting out the chmod and umask calls as suggested, but it did not appear to resolve the issue. Current error message: Parse error: syntax error, unexpected $end in / myproject/cache/frontend/dev/config/config_routing.yml.php on line 14 gist:http://gist.github.com/501193 doing a clear cache, I then get the same error but on the config_autoload.yml.php (which when parsed by php on command line does not give a syntax error) doing a clear cache again, I then get the same error for the config_factories.yml.php file ... actually it seems as though I don't have to do a clear cache, I can just refresh the page and the next error comes up or the page starts working. On Jul 30, 5:20 am, Georg geor...@have2.com wrote: I had a similar issue once. I am not sure what exactly it was, but I think it was two errors playing together. Symfony tries to chmod/umask the cache file after it is written, and I have a virtual linux server accessing the data on a windows share which does not allow chmod. So an error occured after the first cache file was written, but I didn't see the error message because I had the sfErrorNotifier plugin in this env, and it was not configured yet. And after each start only the next cache file was written, so eventually after some tries it worked normally, because in the end all cache files were written. Try to comment out the lines 365 and 366 (chmod, umask) in lib/vendor/symfony/lib/config/sfConfigCache.class.php, this helped in my case. HTH Georg Am 29.07.2010 18:07, schrieb Jonotron: I've just started playing with Symfony 1.4.6 (after having worked with 1.0 many moons ago) and I am having a significant problem with the generated cache files. It seems as though they are not being generated correctly but in an inconsistent manner. I will get syntax errors in a few cache files that will eventually disappear if I cache:clear and reload the page enough times (sometimes requiring 5-6 cache clears). The syntax errors are inconsistent but usually: unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php unexpected $end in /myproject/cache/frontend/dev/config/ config_factories.yml.php I also get the error on the command line when I try a doctrine:build- model. It gets to the resetting application autoloaders step then gives me an unexpected $end in /myproject/cache/frontend/dev/config/ config_autoload.yml.php. This error disappears if I try doctrine:build-model enough times. I am running Ubuntu 10.04, Apache 2.2.14, PHP 5.3.2 with APC (above errors appear with APC on or off) and Symfony 1.4.6 (installed from tar.gz) Any ideas what is going on? It's putting a bad taste in my mouth and quite frustrating to work this way. -- 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