Re: Save doesn't work with Postgres

2007-12-01 Thread Adrian Maier

On Nov 30, 2007 12:01 PM, Rhee [EMAIL PROTECTED] wrote:

 No one has ever this problem?


 On Nov 29, 12:17 pm, Rhee [EMAIL PROTECTED] wrote:
  Does anybody have problem to use Save function with Postgres?
  Everytime I call $this-Model-save($this-data) I get the following
  notice messages (repeated 4 times):
 
  Notice: Undefined index: name in /var/www/htdocs/sid/cake/libs/model/
  dbo/dbo_postgres.php on line 350
 
  and then:
  Warning: Cannot modify header information - headers already sent by
  (output started at /var/www/htdocs/sid/cake/libs/model/dbo/
  dbo_postgres.php:350) in /var/www/htdocs/sid/cake/libs/controller/
  controller.php on line 447
 
  Basically the data were saved into database.
 
  It works well at production level. I believe in this level all notices
  and warnings were suppressed, so it looks like to work perfectly.
  Right now, to avoid the notices I use $this-Model-execute($sql);
  where $sql is an SQL INSERT INTO or UPDATE statement.
 
  I still use Cake v 0.2.9.4409. The same version works well with MySQL.
 
  Any idea to resolve this, except with execute() or maybe upgrade Cake?

Hello,

I've encountered the same error when using a PostgreSQL database.  It's a
bug that has been very recently solved .

Instead of upgrading, i've simply duplicated the fix on the version of cakephp
i was using . The fix is a trivial one:   open the dbo_postgres.php  ,
go to line 350
and modify this if statement :

 if (strcasecmp($sourceinfo['name'], $field) == 0) {
break;
 }

to this :

 if (  isset($sourceinfo['name']) 
strcasecmp($sourceinfo['name'], $field) == 0)   {
break;
 }

You could also try to upgrade to a newer cake , but i'm not sure which
is the first version
that includes this particular bug fix.


Cheers,
Adrian Maier

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Save doesn't work with Postgres

2007-11-30 Thread Rhee

No one has ever this problem?

On Nov 29, 12:17 pm, Rhee [EMAIL PROTECTED] wrote:
 Does anybody have problem to use Save function with Postgres?
 Everytime I call $this-Model-save($this-data) I get the following
 notice messages (repeated 4 times):

 Notice: Undefined index: name in /var/www/htdocs/sid/cake/libs/model/
 dbo/dbo_postgres.php on line 350

 and then:
 Warning: Cannot modify header information - headers already sent by
 (output started at /var/www/htdocs/sid/cake/libs/model/dbo/
 dbo_postgres.php:350) in /var/www/htdocs/sid/cake/libs/controller/
 controller.php on line 447

 Basically the data were saved into database.

 It works well at production level. I believe in this level all notices
 and warnings were suppressed, so it looks like to work perfectly.
 Right now, to avoid the notices I use $this-Model-execute($sql);
 where $sql is an SQL INSERT INTO or UPDATE statement.

 I still use Cake v 0.2.9.4409. The same version works well with MySQL.

 Any idea to resolve this, except with execute() or maybe upgrade Cake?

 Thanks...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Save doesn't work with Postgres

2007-11-29 Thread Rhee

Does anybody have problem to use Save function with Postgres?
Everytime I call $this-Model-save($this-data) I get the following
notice messages (repeated 4 times):

Notice: Undefined index: name in /var/www/htdocs/sid/cake/libs/model/
dbo/dbo_postgres.php on line 350

and then:
Warning: Cannot modify header information - headers already sent by
(output started at /var/www/htdocs/sid/cake/libs/model/dbo/
dbo_postgres.php:350) in /var/www/htdocs/sid/cake/libs/controller/
controller.php on line 447

Basically the data were saved into database.

It works well at production level. I believe in this level all notices
and warnings were suppressed, so it looks like to work perfectly.
Right now, to avoid the notices I use $this-Model-execute($sql);
where $sql is an SQL INSERT INTO or UPDATE statement.

I still use Cake v 0.2.9.4409. The same version works well with MySQL.

Any idea to resolve this, except with execute() or maybe upgrade Cake?

Thanks...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---