Development

#6820 ("Array to string conversion" when you try to make forms with composite foreign key)

You must first sign up to be able to contribute.

Ticket #6820 (closed defect: fixed)

Opened 7 months ago

Last modified 2 months ago

"Array to string conversion" when you try to make forms with composite foreign key

Reported by: teeph Assigned to: Jonathan.Wage
Priority: major Milestone:
Component: sfDoctrinePlugin Version: 1.2.4
Keywords: composite keys Cc:
Qualification: Unreviewed

Description

Hello,

First, sorry for my bad english.

I think i found a bug in sfDoctrineColumn.class.sf when it use with model having composite primary keys and composite foreign keys (see schema.yml with this ticket).

symfony:build-model works correctly and BaseContact?.class.php seems correct:

public function setUp() {

$this->hasOne('Client', array('local' => array(0 => 's20dos', 1 => 's20cat', 2 => 's20cli'),

'foreign' => array(0 => 's10dos', 1 => 's10cat', 2 => 's10cli')));

}

but when i launch doctrine:build-forms, i saw this message : PHP Notice: Array to string conversion in C:\dev\www\ELiSa\lib\symfony\plugins\sfDoctrinePlugin\lib\generator\sfDoctrineColumn.class.php on

line 230

and BaseContactForm? contains some non PHP code (print of errors).

A line 230 of sfDoctrineColumn there is this line : strtolower($relationlocal?) == strtolower($this->name)

The problem is $relationlocal? contains array of keys and not a string. I try to replace this line by a loop for each string (columns name ok my composite key), its seems work but i don't know if it's good solution.

Regards,

TeepH

Attachments

schema.yml (3.9 kB) - added by teeph on 07/10/09 17:34:13.

Change History

07/10/09 17:34:13 changed by teeph

  • attachment schema.yml added.

11/30/09 22:00:46 changed by Jonathan.Wage

  • status changed from new to closed.
  • resolution set to fixed.

(In [24604]) [1.3, 1.4] Fix issue where local is an array (closes #6820)

11/30/09 22:01:16 changed by Jonathan.Wage

Just an FYI, Doctrine 1 does not support composite foreign keys.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.