[symfony-users] Re: Sf 1.4 + Propel + Sqlite : unproper handling of bool criteria

2010-03-18 Thread Massimiliano Arione
Are those fields defined as boolean in your schema?
Anyway, if you put your code in the correct model class, it's not
overwritten at every generation.

cheers
Massimiliano

On 17 Mar, 14:18, SlimShaggy filthy.m...@gmail.com wrote:
 Hello all,
 I am currently migrating an app from Symphony 1.2 to 1.4
 I am using an sqlite db and I encountered a problem with the generated
 queries regarding booleans.

 Here is a part of my source code:
 $c = new Criteria();
 $c-add(ShowPeer::IS_PUBLISHED,true);
 $c-add(ShowPeer::IS_CANCELED,false);

 And here is the generated SQL query:
 SELECT DISTINCT show.ID, show.TITLE, (...)
 WHERE show.IS_PUBLISHED=true AND show.IS_CANCELED=false (...)

 What used to retrieve the data I was looking for no longer works!
 No error generated, just an empty result. On the other end, if I copy
  paste the query in sqlitebrowser I do get an error:
 no such column: true

 That is, booleans don't exist in Sqlite they are just treated as
 integers. It all work fine if I convert true-1 and false-0 in the
 SQL. How comes Sf/propel can't handle this anymore ?

 I tryed to mess around, changing my criteria to
 $c-add(ShowPeer::IS_PUBLISHED,'1');
 $c-add(ShowPeer::IS_CANCELED,'0');
 But even after cleaning the cache it's still generating the same
 query.

 Any clue, someone ? This is driving me nuts

 Vince

-- 
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: Sf 1.4 + Propel + Sqlite : unproper handling of bool criteria

2010-03-18 Thread Gareth McCumskey
Alter your schema to change the type to INTEGER, rebuild the model, do
a symfony cc, then use the queries to check for 1 or 0 but with no
quotes so:

$c-add(ShowPeer::IS_PUBLISHED,1);

instead of:

$c-add(ShowPeer::IS_PUBLISHED,'1');

On Thu, Mar 18, 2010 at 3:15 PM, Massimiliano Arione garak...@gmail.com wrote:
 Are those fields defined as boolean in your schema?
 Anyway, if you put your code in the correct model class, it's not
 overwritten at every generation.

 cheers
 Massimiliano

 On 17 Mar, 14:18, SlimShaggy filthy.m...@gmail.com wrote:
 Hello all,
 I am currently migrating an app from Symphony 1.2 to 1.4
 I am using an sqlite db and I encountered a problem with the generated
 queries regarding booleans.

 Here is a part of my source code:
 $c = new Criteria();
 $c-add(ShowPeer::IS_PUBLISHED,true);
 $c-add(ShowPeer::IS_CANCELED,false);

 And here is the generated SQL query:
 SELECT DISTINCT show.ID, show.TITLE, (...)
 WHERE show.IS_PUBLISHED=true AND show.IS_CANCELED=false (...)

 What used to retrieve the data I was looking for no longer works!
 No error generated, just an empty result. On the other end, if I copy
  paste the query in sqlitebrowser I do get an error:
 no such column: true

 That is, booleans don't exist in Sqlite they are just treated as
 integers. It all work fine if I convert true-1 and false-0 in the
 SQL. How comes Sf/propel can't handle this anymore ?

 I tryed to mess around, changing my criteria to
 $c-add(ShowPeer::IS_PUBLISHED,'1');
 $c-add(ShowPeer::IS_CANCELED,'0');
 But even after cleaning the cache it's still generating the same
 query.

 Any clue, someone ? This is driving me nuts

 Vince

 --
 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



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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: Sf 1.4 + Propel + Sqlite : unproper handling of bool criteria

2010-03-17 Thread SlimShaggy

 Which that change, did you try rebuilding models before clearing cache?

Changed the query, not the model. I tried to rebuild it, thoug
with no success :(

-- 
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: Sf 1.4 + Propel + Sqlite : unproper handling of bool criteria

2010-03-17 Thread Eno
On Wed, 17 Mar 2010, SlimShaggy wrote:

 Changed the query, not the model. I tried to rebuild it, thoug
 with no success :(

I noticed that some symfony plugins had modified their code because of 
this change in Propel so I imagine it might be similar in your case.



-- 


-- 
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