Unknown record property / related component error

This is for discussion, mainly on 1.x but there's some 2.x topics here too.

Moderators: dwhittle, Ian

Unknown record property / related component error

Postby Skyblue18 » Thu Mar 31, 2011 4:27 am

Good day everyone.

I'm new in symfony and having a hard time learning it.
I am currently having a problem that I have been trying to solve for the past 3 days.
I google for possible solutions and found nothing. Though many experience the same problem, their solution is not related to my problem.

Help me please, for I am a little desperate to learn symfony and fix this error.

So here is my problem:

I am creating two drop down with dependencies.The first drop down is a list of Province, and when I choose a Province, automatically the second drop down will list the cities under the selected city.

I have created the drop down but I cant get the dependency to work.

Help me guys, I;m new to this.Here is what I have:

I am using a plugin called "sfDependentSelectPlugin"

config/doctrine/schema.yml

RefRegion:
connection: doctrine
tableName: ref_region
columns:
id:
type: integer(4)
fixed: false
unsigned: true
primary: true
autoincrement: true
rank:
type: integer(1)
fixed: false
unsigned: true
primary: false
notnull: false
autoincrement: false
short_name:
type: string(12)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
region_name:
type: string(60)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
nscb_code:
type: string(2)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Division:
local: id
foreign: region_id
type: one
foreignType: many
Division:
connection: doctrine
tableName: division
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
region_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
code:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
name:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
address:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
superintendent:
type: string(200)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
total_schools:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
elem_school_count:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
secondary_school_count:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
created_at:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
updated_at:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
RefRegion:
local: region_id
foreign: id
type: one
foreignType: one

my code in lib/form/doctrine/UsersForm.class.php

$this->widgetSchema['region_id'] = new sfWidgetFormDoctrineChoice(array(
'model' => 'RefRegion',
'add_empty' => 'Select...',
));

$this->widgetSchema['division_id'] = new sfWidgetFormDoctrineDependentSelect(array(
'model' => 'Division',
'depends' => 'RefRegion',
'add_empty' => 'Select...',
'ajax' => true,
));


And I am getting this error:

Unknown record property / related component "ref_region_id" on "Division"

Any ideas what I am doing wrong?I'm new in symfony. Any help will be very very appreciated.

Thanks
Skyblue18
Junior Member
 
Posts: 7
Joined: Thu Mar 31, 2011 4:05 am

Re: Unknown record property / related component error

Postby Skyblue18 » Thu Mar 31, 2011 7:00 am

Still not getting any help :(
Skyblue18
Junior Member
 
Posts: 7
Joined: Thu Mar 31, 2011 4:05 am

Re: Unknown record property / related component error

Postby Skyblue18 » Thu Apr 07, 2011 8:38 am

I did it. Thanks to myself.
Skyblue18
Junior Member
 
Posts: 7
Joined: Thu Mar 31, 2011 4:05 am

Re: Unknown record property / related component error

Postby hisupatel » Tue Jan 17, 2012 12:46 pm

I am having same problem.

Please help me.

Thanking you
hisupatel
Junior Member
 
Posts: 11
Joined: Sun Oct 10, 2010 12:48 pm

Re: Unknown record property / related component error

Postby hisupatel » Tue Jan 17, 2012 12:49 pm

I am using symfony 1.4.
hisupatel
Junior Member
 
Posts: 11
Joined: Sun Oct 10, 2010 12:48 pm

Re: Unknown record property / related component error

Postby yeuekmn » Mon Feb 13, 2012 8:29 am

Skyblue18 wrote:I did it. Thanks to myself.

hello, can you tell us how solves the problem.

I am having same problem.

Please help me.
yeuekmn
Junior Member
 
Posts: 2
Joined: Sun Sep 04, 2011 12:08 pm

Re: Unknown record property / related component error

Postby Skyblue18 » Tue Mar 20, 2012 8:39 am

I just fix the foreign key relations for the tables needed. That is just what I do. :-)

Hope that helps.
Skyblue18
Junior Member
 
Posts: 7
Joined: Thu Mar 31, 2011 4:05 am


Return to General discussion

Who is online

Users browsing this forum: No registered users and 6 guests