[symfony-users] Re: Serialize or unserialize PDO instances (sfForm) with cache

2008-12-11 Thread Jeremy Benoist

Done http://trac.symfony-project.org/ticket/5267 :-)

J.


On 10 déc, 23:17, Jonathan Wage [EMAIL PROTECTED] wrote:
 Can you create a ticket for this? We need to fix this in the form framework
 so the PDO instance is removed from the form before being serialized.

 Thanks, Jon

 On Wed, Dec 10, 2008 at 3:14 AM, Jeremy Benoist [EMAIL PROTECTED]wrote:



  Anybody had already experienced this problem?
  If I want to keep cache enabled, I see only one solution : avoid all sfForm
  instance parameter from include_partial.
  Maybe I will try to put $form in session or request, we'll see.
  But it won't in the way of refactoring data and good practice I think :-/

  J.

  On Mon, Dec 8, 2008 at 5:59 PM, Jeremy Benoist [EMAIL PROTECTED]wrote:

  Hi,

  I recently enable cache on my website.

  /config/settings.yml
  all:
   cache: on

  /apps/frontend/config/cache.yml
  default:
   enabled: off

  I activate cache for some module and I did nothing for other one. So I
  assume that if I don't have cache.yml file for a module, cache isn't
  enabled. (Even if I have a cache.yml with all: enabled: off, I still
  have the problem).

  In template registrationSuccess.php, I have :

  ?php include_partial('customer/customerForm',array('form'=$form,
  'passwords'=true))?

  Where $form is an instance of CustomerForm.

  I got this error when I go on customer/registration :
  You cannot serialize or unserialize PDO instances

  Full stack trace is available here :http://pastebin.com/mc8ce397

  The only solution is to disable cache...
  But I don't understand why symfony try to put this partial in cache as
  I don't define any cache for this module.

  Thanks in advance for your help

  J.

 --
 Jonathan H. Wage
 Open Source Software Developer  
 Evangelisthttp://www.jwage.comhttp://www.doctrine-project.orghttp://www.symfony-project.org
--~--~-~--~~~---~--~~
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] Reference embedded form fields in template?

2008-12-11 Thread Peter Bowyer

Hi,

I have a form embedded like so:
$profileForm = new ProfileForm($this-object-getProfile());
unset($profileForm['id'], $profileForm['sf_guard_user_id']);
$this-embedForm('Profile', $profileForm);

How do I reference the fields in the template? I've tried:
?php echo $form['Profile']['first_name']?

But this blathers back
500 | Internal Server Error | InvalidArgumentException
Widget first_name does not exist.

As does using
?php echo $form['first_name']?

(And yes the field name is correct!)

Regards,
Peter

-- 
Maple Design Ltd - Web design and application development
http://www.mapledesign.co.uk
+44 (0)845 123 8008

Reg. in England no. 05920531 


--~--~-~--~~~---~--~~
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] sfForms11Plugin and sfForms12Plugin

2008-12-11 Thread Sid Bachtiar

Is it just me or the svn for that two don't work? How can I download
and install one of that plugins?

For sfForms11Plugin I only see an empty lib folder with two text
files, the sfForms12Plugin is absolutely empty.

Regards,

Sid

-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--~--~-~--~~~---~--~~
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: sfForms11Plugin and sfForms12Plugin

2008-12-11 Thread Sid Bachtiar

Never mind, I found out how to :)

Basically just look info Symfony 1.1 or 1.2 svn branch, and just get
the lib/form, lib/validator, and lib/widget.

On Thu, Dec 11, 2008 at 11:11 PM, Sid Bachtiar [EMAIL PROTECTED] wrote:
 Is it just me or the svn for that two don't work? How can I download
 and install one of that plugins?

 For sfForms11Plugin I only see an empty lib folder with two text
 files, the sfForms12Plugin is absolutely empty.

 Regards,

 Sid

 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz




-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--~--~-~--~~~---~--~~
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] Global criteria and behaviours

2008-12-11 Thread Sid Ferreira
Where can I find the docs about writting a behaviour?
Once I've seen a way to set a global clause in a Propel Criteria, wich
would be used in all criterias, does anyone remember anything about it?

-- 
Sidney G B Ferreira
Desenvolvedor Web - Tibox Innovations

Dwight L. Moody

--~--~-~--~~~---~--~~
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] Newforms - Select box values based on a form value?

2008-12-11 Thread Peter Bowyer

Hi,

Is it possible to change the values populating a select box based on 
another form/url parameter?

Let's take an example. I have a 'Place an advert' form, which always 
called with the category ID (to add the advert to) in the URL, and 
which is then submitted via a hidden input.

Each category has tags defined for it, and one needs to be selected 
on the form - but the tags available depend on the category ID!

How do I populate the tags select box with the right options?

Currently it's defined as
'filter_id' = new sfWidgetFormDoctrineSelect(array('model' = 'Filter')),
But this provides no way to filter based on another field's value - 
or even to pass in a value.

I can write a new form field widget without problems, but to make it 
reliant on an internal call to $request-getParameter('category') is 
bad code smell and really mixing up the layers.

I am hoping someone has already worked out a cleaner way to do this - 
or there is support built into sfForm.

Thanks,
Peter


--~--~-~--~~~---~--~~
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: Newforms - Select box values based on a form value?

2008-12-11 Thread Thomas Rabaix

 Hi,

 Is it possible to change the values populating a select box based on
 another form/url parameter?

yes we can !


 [...]

 How do I populate the tags select box with the right options?

You can provide a query parameter to the sfWidgetFormDoctrineSelect

'filter_id' = new sfWidgetFormDoctrineSelect(array(
  'model' = 'Filter'
  'query' =
Doctrine::getTable($this-getModelName())-createQuery('q')-addWhere('q.category_id
= ?, $this-getOption('category_id'));

And just call your form with the otions parameter

$form = new YourForm(new YourModel, array('category_id' =
(int)$request-getParameter('category_id'))

That's all



On Thu, Dec 11, 2008 at 1:08 PM, Peter Bowyer [EMAIL PROTECTED]wrote:


 Hi,

 Is it possible to change the values populating a select box based on
 another form/url parameter?

 Let's take an example. I have a 'Place an advert' form, which always
 called with the category ID (to add the advert to) in the URL, and
 which is then submitted via a hidden input.

 Each category has tags defined for it, and one needs to be selected
 on the form - but the tags available depend on the category ID!

 How do I populate the tags select box with the right options?

 Currently it's defined as
 'filter_id' = new sfWidgetFormDoctrineSelect(array('model' = 'Filter')),
 But this provides no way to filter based on another field's value -
 or even to pass in a value.

 I can write a new form field widget without problems, but to make it
 reliant on an internal call to $request-getParameter('category') is
 bad code smell and really mixing up the layers.

 I am hoping someone has already worked out a cleaner way to do this -
 or there is support built into sfForm.

 Thanks,
 Peter


 



-- 
Thomas Rabaix
Internet Consultant

--~--~-~--~~~---~--~~
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: id for a record in sf_guard_user

2008-12-11 Thread mapelo

Thanks you.

sfContext::getInstance()-getUser()-getGuardUser()-getId()

for the user who is loging.


On 11 dic, 08:04, Marius Rugan [EMAIL PROTECTED] wrote:
 Hi, you can see it for yourself (what methods and what attributes has the
 object)

 echo pre;

 //print_r or var_dump depending on
 //if you prefer latte or expresso :)

 print_r($this-getUser()-getGuardUser());

 echo /pre;
 //do a clean exit
 exit();

 On Thu, Dec 11, 2008 at 8:10 AM, mapelo [EMAIL PROTECTED] wrote:

  How to know the id for a record into sf_guard_user (from fooPeek.php)?
  I know username value.

  $this-getUser()-getGuardUser()-getProfile()-getFirstName()
--~--~-~--~~~---~--~~
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] create database using propel 1.3 ?

2008-12-11 Thread net2000...@gmail.com

When I try to create database using propel 1.3 and custom query I get error

SQLSTATE[HY000]: General error: 2030 This command is not supported in 
the prepared statement protocol yet


task code below:

$query = CREATE DATABASE databasetest;
$stmt = $con-prepare($query);

   $stmt-execute();


Is it possible to create database, user, grant privileges from propel 
for mysql5?? Anybody tried that?

--~--~-~--~~~---~--~~
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: create database using propel 1.3 ?

2008-12-11 Thread Sid Ferreira
how did you configured the database?

On Thu, Dec 11, 2008 at 2:14 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED]wrote:


 When I try to create database using propel 1.3 and custom query I get error

 SQLSTATE[HY000]: General error: 2030 This command is not supported in
 the prepared statement protocol yet


 task code below:

 $query = CREATE DATABASE databasetest;
$stmt = $con-prepare($query);

   $stmt-execute();


 Is it possible to create database, user, grant privileges from propel
 for mysql5?? Anybody tried that?

 



-- 
Sidney G B Ferreira
Desenvolvedor Web - Tibox Innovations

--~--~-~--~~~---~--~~
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: htaccess problem - can't access /admin - only /admin/index.php

2008-12-11 Thread Eno

On Dec 10, 1:32 pm, zero0x [EMAIL PROTECTED] wrote:

 I have this strange problem - I have htaccess in my web dir - and
 there's a admin folder (with index.php as backend app)

 When I go to server/admin - I get frontend's 404 - same for server/
 admin/

 When I go to server/admin/index.php - everything works just fine..


Do you have no_script_name switched on for the admin app?


--


--~--~-~--~~~---~--~~
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: create database using propel 1.3 ?

2008-12-11 Thread net2000...@gmail.com

W odpowiedzi na e-mail od: Sid Ferreira otrzymany dnia 2008-12-11 17:15 :
 how did you configured the database?

 On Thu, Dec 11, 2008 at 2:14 PM, [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:


 When I try to create database using propel 1.3 and custom query I
 get error

 SQLSTATE[HY000]: General error: 2030 This command is not supported in
 the prepared statement protocol yet


 task code below:

 $query = CREATE DATABASE databasetest;
$stmt = $con-prepare($query);

   $stmt-execute();


 Is it possible to create database, user, grant privileges from propel
 for mysql5?? Anybody tried that?




i am using symfony 1.1 with propel 1.3 plugin

databases.yml below

all:
  propel:
class:sfPropelDatabase
param:
  classname:  PropelPDO
  dsn:mysql:dbname=;host=localhost
  username:   admin
  password:   **
  encoding:   utf8
  persistent: true
  pooling:true

I am using mysql administrator account in config above





--~--~-~--~~~---~--~~
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: create database using propel 1.3 ?

2008-12-11 Thread Sid Ferreira
did you used the configure command?

On Thu, Dec 11, 2008 at 3:07 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED]wrote:


 W odpowiedzi na e-mail od: Sid Ferreira otrzymany dnia 2008-12-11 17:15 :
  how did you configured the database?
 
  On Thu, Dec 11, 2008 at 2:14 PM, [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
 
  When I try to create database using propel 1.3 and custom query I
  get error
 
  SQLSTATE[HY000]: General error: 2030 This command is not supported in
  the prepared statement protocol yet
 
 
  task code below:
 
  $query = CREATE DATABASE databasetest;
 $stmt = $con-prepare($query);
 
$stmt-execute();
 
 
  Is it possible to create database, user, grant privileges from propel
  for mysql5?? Anybody tried that?
 
 
 
 
 i am using symfony 1.1 with propel 1.3 plugin

 databases.yml below

 all:
  propel:
class:sfPropelDatabase
param:
  classname:  PropelPDO
  dsn:mysql:dbname=;host=localhost
  username:   admin
  password:   **
  encoding:   utf8
  persistent: true
  pooling:true

 I am using mysql administrator account in config above





 



-- 
Sidney G B Ferreira
Desenvolvedor Web - Tibox Innovations

--~--~-~--~~~---~--~~
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: create database using propel 1.3 ?

2008-12-11 Thread net2000...@gmail.com

W odpowiedzi na e-mail od: Sid Ferreira otrzymany dnia 2008-12-11 18:20 :
 did you used the configure command?

I want to create databases using symfony task or website action

Propel connection is good because I can select records from mysql tables 
- only custom command not working



--~--~-~--~~~---~--~~
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: htaccess problem - can't access /admin - only /admin/index.php

2008-12-11 Thread Marius Rugan
Hi,
i think the best practice is to have a frontend app and a backend app
generated in your project and play with symfony routing (.yml)

what you are trying to achieve is breaking the MVC entry point which is
index.php

your 404 errors come up because:

RewriteRule ^(.*)$ index.php [QSA,L]

which says everything goes in the index.php, in the current directory,
Append the Query String e.g. /blah?id=1value=2 or any other combination and
this is the Last rule,
if matched than don't process any rules.

if you have another app other than symfony in your admin folder
than you could put a rewrite condition and a rule, above the rule declared
above.
if the conditions are met, than L will ensure that it's the Last processed
one.

RewriteCond %{REQUEST_URI} ^/admin/(.*)$
RewriteRule ^/admin/(.*)$ /admin/index.php [QSA,L]

(this doesn't work ... hope somebody has a different approach )
anyone?


On Thu, Dec 11, 2008 at 6:33 PM, Eno symb...@gmail.com wrote:


 On Dec 10, 1:32 pm, zero0x zero0...@gmail.com wrote:

  I have this strange problem - I have htaccess in my web dir - and
  there's a admin folder (with index.php as backend app)
 
  When I go to server/admin - I get frontend's 404 - same for server/
  admin/
 
  When I go to server/admin/index.php - everything works just fine..


 Do you have no_script_name switched on for the admin app?


 --


 


--~--~-~--~~~---~--~~
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.0 column name ACTIVE

2008-12-11 Thread Sid Bachtiar

Hi,

I'm working on an existing project and in one of the table, a column
is named ACTIVE. I don't seem to be able to query ACTIVE=0 using
Criteria+Propel. Is it a special name?

Cheers,

Sid

-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--~--~-~--~~~---~--~~
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: AJAX call with request params to be cached...

2008-12-11 Thread Sumedh

Why is no one replying here? :) ...Is the question foolish? :|

On Dec 11, 11:16 am, Sumedh sumedh.inam...@gmail.com wrote:
 Someone please put some light here... :)

 On Dec 10, 2:25 pm, Sumedh sumedh.inam...@gmail.com wrote:

  Ok...thanks Nickolas...

  But does this work for actions? I basically don't want that action and
  corresponding MySQL calls to get executed...templates would a
  relatively lighter part...

  The Symfony 1.0 documentation shows that if we send and argument to an
  action, we can cache it...
  likehttp://myapp.example.com/user/show/id/12(on-http://www.symfony-project.org/book/1_0/12-Caching)

  So, how do I change the request parameter I am sending to an argument
  to action? :|

  On Dec 9, 8:48 pm, Nickolas Daskalou n...@daskalou.com wrote:

   By the way, you will need to have the cache enabled in your
   apps/appname/config/settings.yml file for the desired environment.

   2008/12/10 Nickolas Daskalou n...@daskalou.com

I'm not sure if this is the case with sf 1.0, but in 1.1 and 1.2 you 
can do
something like the following in one of your templates:

?php

// The $cache_key can be in any format you want really.
$cache_key = 'paramX='.$paramX.' :: paramY='.$paramY;

// How long to cache the data for, in seconds.
$cache_lifetime = 600; // 600 = 10 minutes

if (!cache($cache_key, $cache_lifetime))
{
?

div
Blah blah blah...?php echo $paramX; ? blind mice and ?php echo 
$paramY;
? glasses of milk.
/div

?php
  cache_save();
}

Does that help you?

2008/12/10 Sumedh sumedh.inam...@gmail.com

Anyone here? :|

On Dec 8, 5:04 pm, Sumedh sumedh.inam...@gmail.com wrote:
 Hi Friends,

 I've an AJAX request like -

http://www.example.com/getData?paramX=100paramY=200

 This AJAX response is rendered in a DIV in browser...

 I want to cache this action for given paramX and paramY...I want to
 store HTML response for this URL and then send the same HTML in case
 the same URL is received...

 I am using Symfony 1.0 ...

 The documentation warns that Actions called with a POST method or
 with GET parameters are not cached. but doesn't elaborate on that
 warning... :(

 How can I achieve this?

 Thanks in advance... :)
--~--~-~--~~~---~--~~
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] Logging in production

2008-12-11 Thread Sumedh

Hi Friends,

Need guidance about logging in production environment.

Symfony 1.0 log logs a word [sfException] whenever there is some wrong
query etc...the details can be seen on screen in DEV environment...

But how can I trace the root of the problem in production environment
(I'll just see 500 internal error message on screen)? If I enable
logs, I'll just see the word sfException in the log, and the Action
that created the problem, but not the actual culprit query...

How do you guys trace the problems that occur in production?

Can we write some simple piece of code that asynchronously mails
details of a problem occurred in production to a given mail id?

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



[symfony-users] Re: Symfony 1.0 column name ACTIVE

2008-12-11 Thread Sid Bachtiar

Sorry another false alarm, I have found the problem.

The doSelect function has been overriden to always set ACTIVE=true!

On Fri, Dec 12, 2008 at 4:56 PM, Sid Bachtiar sid.bacht...@gmail.com wrote:
 Hi,

 I'm working on an existing project and in one of the table, a column
 is named ACTIVE. I don't seem to be able to query ACTIVE=0 using
 Criteria+Propel. Is it a special name?

 Cheers,

 Sid

 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz




-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

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