[symfony-users] [symfony2] Missing options in select after block customization

2011-06-15 Thread Rytis Daugirdas
Hello,

I customized choice_widget block by copying it from
div_layout.html.twig to my own template file and adding it under
twig/form/resources in config.yml. My customizations work fine when I
add a choice field with the form builder, but now country fields
are not rendered correctly (empty select widget, no options to choose
from). If I remove the customized block from my template, country
fields are rendered correctly. The customizations I added to
choice_widget cannot affect this since the changes are very basic.
My template does not contain any other customized blocks.

Why did customizing choice_widget break country fields?

Thanks,
Rytis

-- 
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] Validating non-entity fields

2011-06-15 Thread Rytis Daugirdas
Hello,

What is the recommended way to validate form fields that do not belong
to any entity? I don't see this documented anywhere.

For example:

$builder
  -add('entity', new EntityType()) // validated by using constraints
set for Entity
  -add('foo', 'text'); // how do you add constraints here???

I see there's addValidator() method in FormBuilder. Is it meant to be
used in this case?

Thanks,
Rytis

-- 
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: Missing options in select after block customization

2011-06-15 Thread Rytis Daugirdas
My bad, forgot to add extends directive in my template.

On Jun 15, 6:13 pm, Rytis Daugirdas rytis.daugir...@gmail.com wrote:
 Hello,

 I customized choice_widget block by copying it from
 div_layout.html.twig to my own template file and adding it under
 twig/form/resources in config.yml. My customizations work fine when I
 add a choice field with the form builder, but now country fields
 are not rendered correctly (empty select widget, no options to choose
 from). If I remove the customized block from my template, country
 fields are rendered correctly. The customizations I added to
 choice_widget cannot affect this since the changes are very basic.
 My template does not contain any other customized blocks.

 Why did customizing choice_widget break country fields?

 Thanks,
 Rytis

-- 
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] Errors bubble to the main form

2011-06-15 Thread Rytis Daugirdas
Hello,

I have a simple form with a few entity forms embedded into it.
Validation seems to work, but all errors are reported as global
(rendered via form_errors(form)). The same call for each field
(form_errors(field)) does not render any errors at all. I did not set
error_bubbling property anywhere. What could be the problem?

Thanks,
Rytis

-- 
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] Mixing entity and non-entity fields in a single form

2011-06-12 Thread Rytis Daugirdas
Hello,

I have a form type that extends Symfony\Component\Form\AbstractType. I
use it with an entity object. I'd like to add additional fields and
validation constraints to the form, but calling $builder-
add('extraField', ...) produces an error telling that added fields
don't exist in the entity (of course they don't). What is the
recommended solution to this problem? In symfony 1.4, you could easily
add additional fields and use their values in doUpdateObject or
doSave.

Thanks,
Rytis

-- 
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: Mixing entity and non-entity fields in a single form

2011-06-12 Thread Rytis Daugirdas
OK, it seems that form embedding functionality is what I'm looking
for.

On Jun 12, 1:13 pm, Rytis Daugirdas rytis.daugir...@gmail.com wrote:
 Hello,

 I have a form type that extends Symfony\Component\Form\AbstractType. I
 use it with an entity object. I'd like to add additional fields and
 validation constraints to the form, but calling $builder-add('extraField', 
 ...) produces an error telling that added fields

 don't exist in the entity (of course they don't). What is the
 recommended solution to this problem? In symfony 1.4, you could easily
 add additional fields and use their values in doUpdateObject or
 doSave.

 Thanks,
 Rytis

-- 
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: sharing global values between templates

2011-06-03 Thread Rytis Daugirdas
Hello,

Is there a way to easily set a value in one template and make it
available in another (both templates are included by the same layout)?
For example, in a page template I want to set a string value
representing the selected menu item  and use this value in a mini-
template that contains the menu markup. In symfony 1.x,
slot('selectedMenuItem', 'home') would work just fine and the value
would be available in all partials. I don't think symfony2 blocks can
be used for the same purpose. There are also twig variables, but
they're local.

-- 
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: symfony2: sharing global values between templates

2011-06-03 Thread Rytis Daugirdas
JavaScript? It has nothing to do with my question.

On Jun 3, 8:38 pm, Justin Hilles justin.hil...@gmail.com wrote:
 why not use js?

-- 
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] Cache for multiple environments generated

2011-05-23 Thread Rytis Daugirdas
Hello,

I'm playing with symfony2 beta2 right now and I've noticed that if I
load the dev environment on empty cache, symfony generates caches for
both dev and prod environments. Why? Is this expected behaviour?

Rytis

-- 
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: Cache for multiple environments generated

2011-05-23 Thread Rytis Daugirdas
I figured that out. Requests to non-existant files are routed to the
prod controller, so that triggered prod cache initialization.

On May 23, 8:43 pm, Rytis Daugirdas rytis.daugir...@gmail.com wrote:
 Hello,

 I'm playing with symfony2 beta2 right now and I've noticed that if I
 load the dev environment on empty cache, symfony generates caches for
 both dev and prod environments. Why? Is this expected behaviour?

 Rytis

-- 
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] Twig Debug extension

2011-05-23 Thread Rytis Daugirdas
Hello,

If I enable the Debug extension and add {% debug %} in a template, it
either makes the page not load at all (blank) or run out of memory.
What could be the problem?

I'm on Windows 7, PHP 5.3.6.

Thanks,
Rytis

-- 
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] Different Error 500 pages for different languages

2011-05-08 Thread Rytis Daugirdas
Hello,

Is it possible to use different Error 500 pages for different
cultures?

-- 
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] Clearing I18N cache

2011-04-27 Thread Rytis Daugirdas
Hello,

Is there a way to clear the cache of certain (not all) I18N
translation files? I have some dynamic I18N files which are updated by
the application as required and afterwards the changes are not
visible.

Regards,
Rytis

-- 
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] Form objects not escaped

2011-04-18 Thread Rytis Daugirdas
Hello,

I've noticed that form objects are not escaped in templates.

$this-form = new MyObjectForm(); # won't be escaped

Other objects ARE escaped.

$this-myObject = $this-form-getObject(); # will be escaped

This can easily be checked using get_class() in a template.

Anyone could explain this behaviour?

Regards,
Rytis

-- 
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] Propel single table inheritance definition

2011-03-06 Thread Rytis Daugirdas
Hello,

I'm looking for an example of defining single table inheritance using
the alternative schema syntax. The following does not work (no child
classes are generated):

  ParentClass:
...
columns:
  type: { type: varchar, size: 50, required: true }
  ...
inheritance:
  column: type
  classes:
ChildClass1: ChildClass1
ChildClass2: ChildClass2

This is not documented anywhere as far as I can see.

Thanks,
Rytis

-- 
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: Propel single table inheritance definition

2011-03-06 Thread Rytis Daugirdas
False alarm, it works fine.

What confused me was the fact that Base[ChildClass].php files were
missing. However, it turns out those files are not needed.

On Mar 6, 12:05 pm, Rytis Daugirdas rytis.daugir...@gmail.com wrote:
 Hello,

 I'm looking for an example of defining single table inheritance using
 the alternative schema syntax. The following does not work (no child
 classes are generated):

   ParentClass:
     ...
     columns:
       type: { type: varchar, size: 50, required: true }
       ...
     inheritance:
       column: type
       classes:
         ChildClass1: ChildClass1
         ChildClass2: ChildClass2

 This is not documented anywhere as far as I can see.

 Thanks,
 Rytis

-- 
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] Form classes not generated for certain models

2011-02-13 Thread Rytis Daugirdas
Hello,

Forms and filters are not generated for a model named Condition (in
schema.yml). I tested this on a completely new project. Model classes
are generated just fine. There are no error messages, the files in
question are simply not being created. Is this a bug or maybe there is
a list of reserved words somewhere and Condition happens to be one of
them?

I am using Propel.

-- 
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] Adding a global error if embedded forms have errors

2010-12-26 Thread Rytis Daugirdas
Hello,

I have a form with some other forms embedded. I'd like to add a global
error to the main form if any of the embedded forms have errors. How
can I check for errors in embedded forms? Embedded forms are cloned
and they're not bound themselves, so I cannot call hasErrors() on
them. I was thinking about checking for entries in the error schema of
the main form in a post validator, but this does not seem to be
possible because the error schema is created after the validation
process completes.

Is there a straightforward way to do what I want?

Regards,
Rytis

-- 
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] sfPropel15Plugin problem

2010-10-03 Thread Rytis Daugirdas
Hello,

I generated an admin module (propel:generate-admin) for the
corresponding model and there seems to be a routing problem. Upon
running my app I get the following error:

sfPropel15Route::serialize() must return a string or NULL

Here's my routing.yml: http://pastebin.com/NKrcWGaV. If I remove the
generated administrator route collection, the error disappears. I
never had this problem with the pre-1.5 Propel plugin.

What could be the problem?

Regards,
Rytis

-- 
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: sfPropel15Plugin problem

2010-10-03 Thread Rytis Daugirdas
I figured that out. The problem is not related to the plugin itself. I
had a customized segment_separators option in my factories.yml file.

On Oct 3, 1:51 pm, Rytis Daugirdas rytis.daugir...@gmail.com wrote:
 Hello,

 I generated an admin module (propel:generate-admin) for the
 corresponding model and there seems to be a routing problem. Upon
 running my app I get the following error:

 sfPropel15Route::serialize() must return a string or NULL

 Here's my routing.yml:http://pastebin.com/NKrcWGaV. If I remove the
 generated administrator route collection, the error disappears. I
 never had this problem with the pre-1.5 Propel plugin.

 What could be the problem?

 Regards,
 Rytis

-- 
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] Setting a widget's id_format option has no effect

2010-07-25 Thread Rytis Daugirdas
Hello,

It seems that setting the id_format option for widgets has no
effect.

Here's a short example: http://pastebin.com/DLL8d3wz

The expected id is test_suffix but it's set to test as if the
format was never changed. Anyone could explain this behaviour?

Rytis

-- 
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: Propel nested set and sfOutputEscaperIteratorDecorator - too many queries

2010-04-27 Thread Rytis Daugirdas
Massimiliano,

Since when iterators are overkill? IMO, your suggestion is overkill.
Propel documentation clearly states that a tree can be easily
traversed via its iterator interface. Why should I write additional
code (however simple) to get the functionality that is already
provided? Besides, since I need the level of each node, your
suggestion is not suitable as it too makes query count depend on the
number of nodes retreived.

On Apr 27, 4:48 pm, Massimiliano Arione garak...@gmail.com wrote:
 On 26 Apr, 18:11, Rytis Daugirdas rytis.daugir...@gmail.com wrote:

  To output a list of nodes, obviously.

 It looks a bit overkilled to me.
 Just retrieve the whole table ordered by left, and you'll get the
 entire tree.

 cheers
 Massimiiano

 --
 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] Propel nested set and sfOutputEscaperIteratorDecorator - too many queries

2010-04-26 Thread Rytis Daugirdas
Hello,

When using Propel's nested set behaviour, iteration over a node set in
a template (with output escaping enabled) produces too many queries.

Here's an example: http://pastebin.com/KTzDfvwd

Using the unescaped iterator works fine. Is that a bug in
sfOutputEscaperIteratorDecorator? If not, how should the problem be
solved?

Regards,
Rytis

-- 
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: Propel nested set and sfOutputEscaperIteratorDecorator - too many queries

2010-04-26 Thread Rytis Daugirdas
To output a list of nodes, obviously.

On Apr 26, 4:20 pm, Massimiliano Arione garak...@gmail.com wrote:
 It's not clear to me why you want to use an iterator in a template.

 cheers
 Massimiliano

 On 26 Apr, 10:56, Rytis Daugirdas rytis.daugir...@gmail.com wrote:



  Hello,

  When using Propel's nested set behaviour, iteration over a node set in
  a template (with output escaping enabled) produces too many queries.

  Here's an example:http://pastebin.com/KTzDfvwd

  Using the unescaped iterator works fine. Is that a bug in
  sfOutputEscaperIteratorDecorator? If not, how should the problem be
  solved?

  Regards,
  Rytis

  --
  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 
 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] Propel 1.4 and multi-column PKs

2010-03-26 Thread Rytis Daugirdas
Hello,

I'm trying to define a multi-column PK for a table containing many-to-
many relationships. This is what I have:

  UserGroupRelation:
tableName: UserGroupRelations
columns:
  userId:  { type: integer, required: true, primary: true }
  groupId: { type: integer, required: true, primary: true }
foreignKeys:
  -
foreignTable: Users
onDelete: cascade
references:
  - { local: userId, foreign: id }
  -
foreignTable: Groups
onDelete: cascade
references:
  - { local: groupId, foreign: id }

However, for some reason, [id] column is automatically added and used
as a PK. How can I force Propel to use [userId, groupId] as a
composite PK?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Updating existing database records with symfony forms

2009-11-30 Thread Rytis Daugirdas
Hello,

I accidentally noticed that by default symfony generated forms allow
updating of existing objects without passing the primary key(s) in the
$taintedValues array which results in odd behavior (to me, anyway).
Here's a simple example:

$f = new ObjectForm(Doctrine_Core::getTable('Object')-findOneByColumn
('value'));
$f-bindAndSave($data); # $data is valid and does NOT contain the
primary key

During the update process the form will not use the primary key that
is set in the object passed to the constructor. For example, in my
case, the object row in the database is updated but the PK is set to
0! If $data in the example does contain the PK value, it's fine.

Is this the expected behavior in this case? I expected the form not to
touch the PK while updating.

Regards,
Rytis

--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Doctrine NestedSet and output escaping

2009-08-20 Thread Rytis Daugirdas

Hello,

I've run into a weird problem when using doctrine NestedSet behavior
together with symfony 1.2.

In the action:

$this-tree = Doctrine::getTable('Group')-getTree()-fetchTree();

In the template:

?php foreach ($tree as $g): ?
?php echo $g-getNode()-isLeaf() //this issues an additional
query ?
?php endforeach ?

?php foreach ($tree-getRawValue() as $g): ?
?php echo $g-getNode()-isLeaf() //this does not issue an
additional query ?
?php endforeach ?

The problem seems to be connected to output escaping. Why additional
queries are executed when iterating over escaped values? $object-
getNode() should NEVER issue a query if the object the node belongs
to is loaded properly.

Regards,
Rytis
--~--~-~--~~~---~--~~
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] Rebuilding model

2009-07-21 Thread Rytis Daugirdas

Hello,

Do I need to rebuild my model after changing my database backend (for
example, when switching from MySQL to SQLite)? The ORM is Doctrine.
--~--~-~--~~~---~--~~
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] Solving a concurrency problem

2009-06-01 Thread Rytis Daugirdas

Hello,

I'm having what seems to be a concurrency problem while using Propel
1.3. Below is a small example of the save method of a Propel object.

public function save(PropelPDO $con = null) {
$con = Propel::getConnection();
try {
$con-beginTransaction();
sleep(3); // ignore this, used for testing only
parent::save($con);
$foo = $this-getFoo(); // Propel object, triggers a
SELECT

// stuff is happening here...

$foo-save($con);
$con-commit();
} catch (Exception $e) {
$con-rollBack();
throw $e;
}
}

The problem is the $foo object. Let's say we get two calls of the
example method one after another in a very short time. In some cases,
if the second transaction reads $foo...

$foo = $this-getFoo();

... before the first transaction has had the chance to save it...

$foo-save($con);

... $foo read by the second transaction will be outdated and bad
things will happen.

How can I force the locking of the table Foo objects are stored in so
that subsequent transactions can read from it only after the first one
has finished its work?
--~--~-~--~~~---~--~~
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: N - M relationships and symfony forms (Propel)

2009-02-18 Thread Rytis Daugirdas
For those who may have missed it too - don't define an id column for the
relation table (ArticleCategoryRelation in my example) and you'll get the
N:M stuff in your forms.

Regards,
Rytis

On Sun, Feb 15, 2009 at 10:56 PM, Rytis Daugirdas rytis.daugir...@gmail.com
 wrote:

 Hello,

 Does symfony handle N - M relationships in any way? For example:

   Category:
 tableName: pp_category
 columns:
   id:
   name: { type: varchar(255), required: true }

   Article:
 tableName: pp_article
 columns:
   id:
   title: { type: varchar(255), required: true }

   ArticleCategoryRelation:
 tableName: pp_article_category_relation
 columns:
   id:
   article_id:  { type: integer, required: true }
   category_id: { type: integer, required: true }
 foreignKeys:
   -
 foreignTable: pp_article
 onDelete: cascade
 references:
   - { local: article_id, foreign: id }
   -
 foreignTable: pp_category
 onDelete: cascade
 references:
   - { local: category_id, foreign: id }

 I inspected the generated forms for this example and they don't seem to
 include any many-to-many funcionality. For example, there's no widget to
 select categories an article belongs to. The same applies to filter forms.

 Am I missing something, or is this functionality simply not implemented in
 symfony?

 Regards,
 Rytis


--~--~-~--~~~---~--~~
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] N - M relationships and symfony forms (Propel)

2009-02-15 Thread Rytis Daugirdas
Hello,

Does symfony handle N - M relationships in any way? For example:

  Category:
tableName: pp_category
columns:
  id:
  name: { type: varchar(255), required: true }

  Article:
tableName: pp_article
columns:
  id:
  title: { type: varchar(255), required: true }

  ArticleCategoryRelation:
tableName: pp_article_category_relation
columns:
  id:
  article_id:  { type: integer, required: true }
  category_id: { type: integer, required: true }
foreignKeys:
  -
foreignTable: pp_article
onDelete: cascade
references:
  - { local: article_id, foreign: id }
  -
foreignTable: pp_category
onDelete: cascade
references:
  - { local: category_id, foreign: id }

I inspected the generated forms for this example and they don't seem to
include any many-to-many funcionality. For example, there's no widget to
select categories an article belongs to. The same applies to filter forms.

Am I missing something, or is this functionality simply not implemented in
symfony?

Regards,
Rytis

--~--~-~--~~~---~--~~
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: CSRF tokens and attacks

2009-02-15 Thread Rytis Daugirdas

 Now, what prevents a hacker from writing a javascript to retrieve a page
 from a logged in user on my site, retrieve the CSRF token and make another
 javascript request using the token on my forms??


Tell me how you would do this. By doing that you'll discover the
difficulties yourself.

Regards,
Rytis

On Mon, Feb 16, 2009 at 12:46 AM, Hassen Ben Tanfous 
hassenbentanf...@gmail.com wrote:

 Hi,
   I started looking at the new code in symfony 1.2 and I have a question.

 If I understand the way CSRF token works, it is generated as a hidden field
 in a form and if I use the link_to helpers, it is appended as a parameter in
 my links.

 Am I right?

 Now, what prevents a hacker from writing a javascript to retrieve a page
 from a logged in user on my site, retrieve the CSRF token and make another
 javascript request using the token on my forms??

 Thanks in advance for any replies
 Cheers

 -Hassen Ben Tanfous

 


--~--~-~--~~~---~--~~
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] Customizing labels when rendering an sfForm

2009-02-14 Thread Rytis Daugirdas
Hello,

Is it possible to customize field labels when calling
sfForm::render($attributes)? If yes, what is the structure of the
$attributes array I should use?

Regards,
Rytis

--~--~-~--~~~---~--~~
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] Forcing arrays in YAML

2009-02-13 Thread Rytis Daugirdas
Hello,

Is there a way to define arrays at the first node level of YAML? For
example:

all:
  my_config:
...

sfConfig::get('prefix_my_config'); // would return an array

I really hate to add additional levels all the time that don't serve any
purpose except to force array parsing.

Regards,
Rytis

--~--~-~--~~~---~--~~
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] sfAction::renderPartial() - status code overriden?

2009-01-22 Thread Rytis Daugirdas
Hello,

I'm having some weird behaviour on my client's server.

Have a look at the following action examples:

public function execute($request) {
$this-getResponse()-setStatusCode(400);
return $this-renderText('Hello');
}

public function execute($request) {
$this-getResponse()-setStatusCode(400);
return $this-renderPartial('global/errorList');
}

You can see that in both cases I set 400 HTTP status code (that's what the
response should have). The problem is that the first example works fine (I
do get 400 response), but the second example always returns 200. I have no
idea what's wrong - the partial contains only text (one word).

Could someone suggest a possible solution to this or help diagnose the root
of the problem?

Thanks,
Rytis

--~--~-~--~~~---~--~~
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 with list filters in administration

2008-12-09 Thread Rytis Daugirdas
Hello,

I'm having some problems with cutomizing list filters.

   1. The filters don't seem to work at all if peer_method is used changed
   under list key in generator.yml. I have a custom peer_method which works
   fine in the list view, but filtering doesn't have any effect. If I remove
   peer_method, the filter does work. What's wrong?
   2. I also tried to customize the presentation of certain filter fields.
   For example, I tried replacing the default text input fields that are
   defined in the base form filter with custom dropdowns:

   class MyObjectFormFilter extends BaseMyObjectFormFilter {
   public function configure() {
   $this-widgetSchema['location'] = new sfWidgetFormChoice(array(
   'choices' = array('' = 'Please select...') +
   sfConfig::get('my_object_location_list')
   ));
   $this-validatorSchema['location'] = new sfValidatorChoice(array(
   'required' = false,
   'choices'  = array_keys(sfConfig::get('
   my_object_location_list'))
   ), array(
   'invalid'  = 'Bah.'
   ));
   }
   }

   After this customization the location field is never filtered. I can
   select an option in the filter form and it remains selected after the filter
   form submission, but the actual SQL query is not affected in any way - as if
   I didn't select any option. What am I doing wrong here?


-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Using routes from another application (sf 1.2)

2008-12-08 Thread Rytis Daugirdas
Hello,

Is it possible to generate URLs of routes that are defined in another
application under the same project? If yes, a small example would be great.

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Questions related to the new admin generator (sf 1.2.0 + Propel 1.3)

2008-12-02 Thread Rytis Daugirdas
Hello,

I have the following questions regarding the admin generator:

   - Is it possible to set different form classes for new and edit views? I
   can probably override this in the actions themselves, but it would be better
   to set this in the generator.yml itself.
   - For some reason since 1.2.0 I do not get the column sorting interaction
   anymore. I am not 100% sure, but I think this feature was available in
   1.2.0-RC2. What could be the problem?

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Questions related to the new admin generator (sf 1.2.0 + Propel 1.3)

2008-12-02 Thread Rytis Daugirdas
All right. What about my first question?

On Tue, Dec 2, 2008 at 2:13 PM, Fabian Lange 
[EMAIL PROTECTED] wrote:

 Hi Rytis,

 somehow the sorting broke recently, I am sorry about this. There is already
 a ticket and it will be fixed in 1.2.1
 http://trac.symfony-project.org/ticket/5123

 Fabian


 On Tue, Dec 2, 2008 at 12:14 PM, Rytis Daugirdas 
 [EMAIL PROTECTED] wrote:

 Hello,

 I have the following questions regarding the admin generator:

- Is it possible to set different form classes for new and edit views?
I can probably override this in the actions themselves, but it would be
better to set this in the generator.yml itself.
- For some reason since 1.2.0 I do not get the column sorting
interaction anymore. I am not 100% sure, but I think this feature was
available in 1.2.0-RC2. What could be the problem?

 --
 Regards,
 Rytis



 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sf 1.2 admin generator - action does not exist

2008-12-01 Thread Rytis Daugirdas
Hello,

I've run into a problem with admin generator.

php symfony propel:generate-admin admin Administrator

Now I go to http://localdomain/admin_dev.php/administrators and I get
sfError404Exception: Action administrators/index does not exist.

What could be the problem? The cache is cleared.

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sf 1.2 admin generator - action does not exist

2008-12-01 Thread Rytis Daugirdas
Well, I am not sure. Yes, /administrator does work, BUT the documentation
indicates a plural form:

http://www.symfony-project.org/book/1_2/14-Generators

http://localhost/backend.php/article*s*


Anyway, thanks for helping, it does work, even if not according to the
documentation.

On Mon, Dec 1, 2008 at 3:05 PM, Alistair Stead 
[EMAIL PROTECTED] wrote:

 You have a typo in your URL should it not be administrator? singular?
 Regards

 Alistair

 2008/12/1 Rytis Daugirdas [EMAIL PROTECTED]

 Hello,

 I've run into a problem with admin generator.

 php symfony propel:generate-admin admin Administrator

 Now I go to http://localdomain/admin_dev.php/administrators and I get
 sfError404Exception: Action administrators/index does not exist.

 What could be the problem? The cache is cleared.

 --
 Regards,
 Rytis




 --
 Alistair Stead
 Senior Interactive Developer

 Mobile: +44 (0) 7788 107 333
 Email: [EMAIL PROTECTED]
 WWW: designdisclosure.com


 The information contained in this email is confidential and may contain
 proprietary information. It is meant solely for the intended
 recipient/recipients. Access to this email by anyone else is unauthorised.
 If you are not the intended recipient, any disclosure, copying, distribution
 or any action taken or omitted in reliance on this, is prohibited and may be
 unlawful. Please consider the environment before printing this e-mail.

 



-- 
Su pagarba,
Rytis Daugirdas

UAB Internovitas

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Customizing embedded form error messages (sf 1.2)

2008-11-29 Thread Rytis Daugirdas
Hello,

I have a form with another form embedded in it. The errors related to the
fields of the embedded form are formatted like this:

*field_name [some error message]*

Is there a way to change the formatting? For example, hide the field name
and leave the message only:

*some error message*

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Missing PDO returned rows in templates?

2008-11-28 Thread Rytis Daugirdas
Hello,

I've just upgraded from 1.1 to 1.2. It went all right, but I don't get all
the results from SELECT queries in templates when using PDO.

In the action:

$this-memberRs = MyPeer::doSelectStmt(...);
// I get 3 rows (correct)
while ($row = $this-memberRs-fetch(PDO::FETCH_NUM)) {
echo $row[1];
}

In the template:

// I get 2 rows (wrong, the first row is missing)
while ($row = $memberRs-fetch(PDO::FETCH_NUM)) {
echo $row[1];
}

I thought maybe the output escape decorator is interfering, so I tried
$memberRs-getRawValue()-fetch(...), but that didn't help.

Anyone knows what's happening?

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sfForm postValidator issue

2008-11-16 Thread Rytis Daugirdas
I don't see anything useful there that would relate to my question. That
form does not use any password validation besides comparing the two
passwords for equality.
On Sat, Nov 15, 2008 at 9:50 PM, ken [EMAIL PROTECTED] wrote:


 check sfGuardUserForm from sfGuardPlugin for example snippet

 On Nov 15, 6:43 pm, Rytis Daugirdas [EMAIL PROTECTED]
 wrote:
   Hello,
 
  I've noticed that my password sfValidatorSchemaCompare validator that is
 set
  as the post validator is run even if the passwords it compares do not
 pass
  the regular validation.
 
  For example, I place a restriction of 8 character minimum length on the
  password field. Even if the password entered was shorter, the
 postValidator
  is still fired and appends its own error. I think this is not the
 expected
  behavior. IMO, the postValidators should fire only if the fields already
  pass their regular validation rules.
 
  Maybe I am missing something and it's possible to configure the
  sfValidatorSchemaCompare validator to only validate VALID fields?
 
  --
  Regards,
  Rytis
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfForm postValidator issue

2008-11-15 Thread Rytis Daugirdas
Hello,

I've noticed that my password sfValidatorSchemaCompare validator that is set
as the post validator is run even if the passwords it compares do not pass
the regular validation.

For example, I place a restriction of 8 character minimum length on the
password field. Even if the password entered was shorter, the postValidator
is still fired and appends its own error. I think this is not the expected
behavior. IMO, the postValidators should fire only if the fields already
pass their regular validation rules.

Maybe I am missing something and it's possible to configure the
sfValidatorSchemaCompare validator to only validate VALID fields?

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Adding a new widget to a form

2008-11-12 Thread Rytis Daugirdas
Hello,

What is the preferred way to add a new widget and its validator(s) to a form
that already has some widgets configured? The documentation only indicates
setWidgets() method, there's no setWidget() or addWidget() method. From what
I see, I can probably use setWidgets() for that:

$widgets = $this-widgetSchema-getFields();
$widgets['my_new_field'] = new sfWidgetFormInput();
$this-setWidgets($widgets);

But this looks odd. What about this?

$this-widgetSchema['my_new_field'] = new sfWidgetFormInput();

But I'm not sure if that would work correctly since setWidgets() does more
than only assigning the widgets to the schema.

What's the right way?

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Including a conditional IE stylesheet

2008-11-10 Thread Rytis Daugirdas
Hello,

I can't seem to find a reliable way to include a conditional IE stylesheet
as the last stylesheet. For example:

head
!-- ... --
!--[if (gte IE 5.5)(lt IE 7)]
link href=/css/public/ie6.css rel=stylesheet type=text/css
media=all /
![endif]--
/head

I absolutely need it as the last stylesheet in the list. How do I do this?

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Including a conditional IE stylesheet

2008-11-10 Thread Rytis Daugirdas
I already have a filter set up, but Thomas' solution is better suited in my
case. Thanks.

On Mon, Nov 10, 2008 at 7:31 PM, dthomas-wwp 
[EMAIL PROTECTED] wrote:


 If you maintain several layouts and don't want to have to update each
 one individually, another option would be to create an sfFilter
 subclass. See
 http://www.symfony-project.org/book/1_1/06-Inside-the-Controller-Layer#Filters
 for info.  If you look at the Samle Filters section, you'll see an
 example of a Google Analytics being injected into each page before it
 is rendered.  You could adapt from this example and use
 str_ireplace('/head', $desired_stylesheet_snippet.'/head',
 $response-getContent()) to inject your stylesheet just before the
 close of the head element.

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Configure post validator

2008-10-07 Thread Rytis Daugirdas
Hello,

What is currently the best way to change options and messages of post
validators?

$this-validatorSchema-setPostValidator(
  new sfValidatorAnd(array(
new sfValidatorPropelUnique(array('model' = 'User', 'column' =
array('username'))),
new sfValidatorPropelUnique(array('model' = 'User', 'column' =
array('email'))),
  ))
);

For example, how do I set the 'invalid' error message of the email
validator? I can probably use a long chain of getters to do what I want such
as...

$validators = $this-validatorSchema-getPostValidator()-getValidators();
$validators[1]-setMessage('invalid', 'Email exists.');

... but is there a cleaner way to do what I want?

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Configure post validator

2008-10-07 Thread Rytis Daugirdas
Sorry, I should have mentioned that the sample snippet is from a Propel form
(generated using propel:build-forms) which cannot be edited directly (only
extended).

-- 
Regards,
Rytis

On Tue, Oct 7, 2008 at 2:11 PM, julien meyer [EMAIL PROTECTED] wrote:

 Hello,

 maybe I don't understood, but I think that the following snippet should
 works fine :


 $this-validatorSchema-setPostValidator(
   new sfValidatorAnd(array(
 new sfValidatorPropelUnique(array('model' = 'User', 'column' =
 array('username')), array('invalid' = 'User exists.')),
 new sfValidatorPropelUnique(array('model' = 'User', 'column' =
 array('email')), array('invalid' = 'Email exists.')),
   ))
 );


 Take a look :
 http://www.symfony-project.org/api/1_1/sfValidatorPropelUnique





 2008/10/7 Rytis Daugirdas [EMAIL PROTECTED]

 Hello,

 What is currently the best way to change options and messages of post
 validators?

 $this-validatorSchema-setPostValidator(
   new sfValidatorAnd(array(
 new sfValidatorPropelUnique(array('model' = 'User', 'column' =
 array('username'))),
 new sfValidatorPropelUnique(array('model' = 'User', 'column' =
 array('email'))),
   ))
 );

 For example, how do I set the 'invalid' error message of the email
 validator? I can probably use a long chain of getters to do what I want such
 as...

 $validators = $this-validatorSchema-getPostValidator()-getValidators();
 $validators[1]-setMessage('invalid', 'Email exists.');

 ... but is there a cleaner way to do what I want?

 --
 Regards,
 Rytis




 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Logging configuration confusion

2008-09-25 Thread Rytis Daugirdas
Yeah, cache is cleared...

Anyone else could check the same? I would feel better if I knew I'm not
alone with this problem :).

On Thu, Sep 25, 2008 at 2:58 PM, cokker [EMAIL PROTECTED] wrote:


 Have you cleared your cache?

 If this doesn't work. I have no idea.

 Greets
 Sven

 Rytis Daugirdas schrieb:
  Hello,
 
  I've recently started a new project based on symfony 1.1.2. However, I'm
 not
  sure if my logging configuration is correct since I'm not seeing the
 right
  behavior.
 
  Basically I want to log only 'err' level errors in prod environment. This
 is
  what I have in factories.yml:
 
  prod:
logger:
  param:
level: err
 
  I'm only changing the level param - everything else should stay the same.
  However, nothing is logged. For example, I tried loading a wrong URL to
  generate an sfError404Exception but no error was logged. Doing the same
 in
  dev env logs the error fine.
 
  Any ideas what could be wrong? Btw, logging_enabled is on by default in
  settings.yml and thus applies to prod.
 


 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Logging configuration confusion

2008-09-24 Thread Rytis Daugirdas
Hello,

I've recently started a new project based on symfony 1.1.2. However, I'm not
sure if my logging configuration is correct since I'm not seeing the right
behavior.

Basically I want to log only 'err' level errors in prod environment. This is
what I have in factories.yml:

prod:
  logger:
param:
  level: err

I'm only changing the level param - everything else should stay the same.
However, nothing is logged. For example, I tried loading a wrong URL to
generate an sfError404Exception but no error was logged. Doing the same in
dev env logs the error fine.

Any ideas what could be wrong? Btw, logging_enabled is on by default in
settings.yml and thus applies to prod.

-- 
Regards,
Rytis

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Validating a non-required field

2008-05-07 Thread Rytis Daugirdas

Sorry, but it doesn't seem to work, or I misunderstood you:

fields:
  my-field:
required: false
MyValidator:
  value_error: My error.

MyValidator is not executed, yet the log contains the following
message:

{sfRequest} error in form for parameter my-field (with message )

On May 6, 3:41 pm, Rytis Daugirdas [EMAIL PROTECTED] wrote:
 Thanks.

 On May 6, 3:30 pm, Lee Bolding [EMAIL PROTECTED] wrote:

  In your validate.yml just set required: false for the field

  On 6 May 2008, at 13:10, Rytis Daugirdas wrote:

   Hello,

   Is it possible to define a validator that would be executed with each
   request, no matter if the field it validates is empty or not? Or is my
   only option to do that in the validate() method of my action?

   Regards,
   Rytis
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Validating a non-required field

2008-05-06 Thread Rytis Daugirdas

Hello,

Is it possible to define a validator that would be executed with each
request, no matter if the field it validates is empty or not? Or is my
only option to do that in the validate() method of my action?

Regards,
Rytis
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Validating a non-required field

2008-05-06 Thread Rytis Daugirdas

Thanks.

On May 6, 3:30 pm, Lee Bolding [EMAIL PROTECTED] wrote:
 In your validate.yml just set required: false for the field

 On 6 May 2008, at 13:10, Rytis Daugirdas wrote:



  Hello,

  Is it possible to define a validator that would be executed with each
  request, no matter if the field it validates is empty or not? Or is my
  only option to do that in the validate() method of my action?

  Regards,
  Rytis
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: sfWebRequest error

2008-04-17 Thread Rytis Daugirdas

All right, done.

http://trac.symfony-project.com/ticket/3357

On Apr 17, 3:00 am, Kiril Angov [EMAIL PROTECTED] wrote:
 Seems like it... create a ticket in Trac. Whatever it is it is not
 supposed to show fatal error but should handle it properly.

 Kiril

 On Wed, Apr 16, 2008 at 1:20 PM, Rytis Daugirdas

 [EMAIL PROTECTED] wrote:

   Hello,

   I need to be able to use request objects (sfWebRequest) in my
   automated tests.

   Running the following

   -
   $request = new sfWebRequest();
   $request-initialize(sfContext::getInstance());
   $request-setError('id', 'error');
   echo $request-getError('id');
   -

   in CLI environment produces the following error:

   -
   PHP Fatal error:  Call to a member function formatExists() on a non-
   object in C:
   \Software\PHP\PEAR\symfony\i18n\sfI18N.class.php on line 132

   Fatal error: Call to a member function formatExists() on a non-object
   in C:\Soft
   ware\PHP\PEAR\symfony\i18n\sfI18N.class.php on line 132
   -

   Is this a bug?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] sfWebRequest error

2008-04-16 Thread Rytis Daugirdas

Hello,

I need to be able to use request objects (sfWebRequest) in my
automated tests.

Running the following

-
$request = new sfWebRequest();
$request-initialize(sfContext::getInstance());
$request-setError('id', 'error');
echo $request-getError('id');
-

in CLI environment produces the following error:

-
PHP Fatal error:  Call to a member function formatExists() on a non-
object in C:
\Software\PHP\PEAR\symfony\i18n\sfI18N.class.php on line 132

Fatal error: Call to a member function formatExists() on a non-object
in C:\Soft
ware\PHP\PEAR\symfony\i18n\sfI18N.class.php on line 132
-

Is this a bug?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Creole::COMPAT_ASSOC_LOWER

2008-04-01 Thread Rytis Daugirdas

Hello,

Where should I set Creole::COMPAT_ASSOC_LOWER flag in symfony?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Multiple apps vs single app

2008-03-03 Thread Rytis Daugirdas

Hello,

I will be starting a new project using symfony and I'm weighing my
decision to create multiple apps vs a single app.

Basically, the project will consist of a public area and two protected
areas (registration required, completely separate user types). Both
protected areas will contain the functionality from the public area
accounting for ~40% of the total functionality of each of them. The
remaining 60% of the functionality is completely unique to both
protected areas.

In short:

Public Area: Functionality
Protected Area 1 (Functionality1 + Functionality)
Protected Area 2 (Functionality2 + Functionality)

I have already successfully completed a few moderate symfony projects
and without thinking too much I've always used single-app approach
(even if there were different types of users). However, I noticed
certain aspects of the code/configuration which I would rather avoid.
For example, routing.yml becomes a monster for a bigger app and
depending on the user type logged in, some of the rules can never be
used by that user type. Other configuration files get cluttered as
well. Getting the logged in user (in an Action) would return a
different type of user depending on who's logged in (weird).

These were some of the things I didn't like in my previous approach.

I would certainly prefer multiple apps since conceptually it's the
right thing to do, but I'm not sure if I'm not going to run into
problems/annoyances later.

Have you had much success when running multiple apps which had to
share certain functionality/layout/assets? Have you run into any
problems?

Is subdomain approach the only reliable way to get rid of the .php
extension in all apps?

Any comments would be greatly appreciated.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Cache problems

2008-01-28 Thread Rytis Daugirdas

Hello,

I'm having two caching problems with symfony 1.0.11 - a minor and a
major one.

I have caching turned on by default (together with layout, app
cache.yml) since the website I'm currently working on is almost
completely static. This, as I understand it, enables caching for
everything: layout, actions, components, etc. I use a component which
outputs context based data - for that I have contextual property set
to true. This component is present on every page of the website (it's
a menu, actually).

There's also a single action that I do not wish to cache. I have set
enabled property to off for this action in cache.yml of its module.
That didn't turn off component caching for that action and that's
fine. However, here comes the major problem: the component is cached
with each different POST request to that action. By different I mean
POST parameters being different. symfony creates folder structure
'var1/value1/var2/value2/...' (var# being POST variable name) and in
the deepest folder puts the cached output of the component (the output
is always the same).

symfony book states that POST requests are not cached, but in my case
this doesn't seem to be the case. Am I doing something wrong? Is there
a workaround to this?

Another problem is that the dev env doesn't seem to correctly report
whether certain parts of the layout come from the cache or not. They
always have blue headers, although I can clearly see the cached
content is there in the cache dir.

Regards,
Rytis
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---