Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Invalid
-
Affects Version/s: 1.2.0-ALPHA3
-
Fix Version/s: 1.2.0-BETA1
-
Component/s: Data Fixtures
-
Labels:None
-
Environment:Ubuntu, PHP 5.3, Symfony 1.3-beta, MySQL 5.1
Description
Schema fragment:
Invoice:
actAs:
Timestampable: ~
tableName: invoice
columns:
id:
type: integer(4)
primary: true
autoincrement: true
billingDate:
type: date
dueDate:
type: date
hostingAccount_id:
type: integer(4)
relations:
invoiceItems:
class: InvoiceItem
local: id
type: many
foreign: invoice_id
foreignType: one
#
InvoiceItem:
actAs:
Timestampable: ~
tableName: invoiceItem
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(100)
quantity:
type: integer(4)
cost:
type: decimal(10)
scale: 2
notnull: false
default: null
invoice_id:
type: integer(4)
With the following fixture fragment:
Invoice:
testInvoice01:
billingDate: "2009-11-11"
dueDate: "2009-11-16"
owningAccount: TestAcc01
invoiceItems:
invItem01:
name: TestLine01
quantity: 2
cost: 12.99
invItem02:
name: TestLine02
quantity: 1
cost: -2.50
testInvoice02:
billingDate: "2009-11-11"
dueDate: "2009-11-21"
owningAccount: TestAcc01
invoiceItems:
invItem01:
name: TestLine03
quantity: 2
cost: 12.99
invItem02:
name: TestLine04
quantity: 1
cost: -2.50
The reuse of the invItem01 & invItem02 tags - even as children of separate parents causes an error.
The reported error was very confusing:
[Doctrine_Connection_Mysql_Exception]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'created_at' cannot be null
Making the child tags unique fixed the issue.
The same fixture loaded without problems in Doctrine 1 (I think 1.0.18 but it's not listed in the released versions above).
I've experienced the same bug. We moved from symfony 1.2 to 1.3 for beta testing.
This example might help as well.
{ alias: BOSTON COLLEGE }Team:
NCAAF-BostonCollege:
Sport: NCAAF
name: Boston College Golden Eagles
logo: boston_college.gif
Conference: NCAAF-ACC
Division: NCAAF-ACC-Atlantic
TeamAlias:
a1:
a2:
{ alias: BC }NCAAF-FloridaState:
{ alias: FLORIDA STATE }Sport: NCAAF
name: Florida State Seminoles
logo: florida_state.gif
Conference: NCAAF-ACC
Division: NCAAF-ACC-Atlantic
TeamAlias:
a1:
a2:
{ alias: FSU }a3:
{ alias: Florida St }In 1.0.x we were able to load all of these teams with x number of aliases. In 1.2 when TeamAlias was actAs: Timestampable we got the result as mentioned in the bug description. But when we removed the Timestampable the a1 aliases would load but none of the a2's or a3's...
Hope that helps. Thanks guys.