| [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #92047] |
Fri, 22 January 2010 16:10  |
Choup Messages: 9 Registered: January 2010 Location: France |
Junior Member |
|
|
Hello,
I've a problem with the plugin sfDoctrineGuardPlugin. I have follow the readme of the plugin ( http://www.symfony-project.org/plugins/sfdoctrineGuardPlugin ) and all seems to be ok.
I was able to be authentify with the admin user, and use my modules. But when i've tried to create a relation into my table 'personne' with the table 'sfGuardUser' that become dramatic.
I've create a foreign key 'user_id' in 'personne' which references to 'id' in the table 'sfGuardUser'. After that, impossible to do a ./symfony doctrine:data-load task correctly :
>> doctrine Loading data fixtures from "/hom...eon/Intranet-CCTB/data/fixtures"
>> doctrine Loading data fixtures from "/hom...ctrineGuardPlugin/data/fixtures"
Unknown record property / related component "sfguardgroup" on "sfGuardGroupPermission"
And then nothing is add in my database, even if i change the data which sould be added, if i delete the admin data in my database, and even if i delete the foreign key relation .
My data/fixtures/sfGuard.yml is :
sfGuardUser:
sgu_admin:
username: admin
password: admin
is_super_admin: true
sfGuardPermission:
sgp_admin:
name: admin
description: Administrator permission
sfGuardGroup:
sgg_admin:
name: admin
description: Administrator group
sfGuardGroupPermission:
sggp_admin:
sfGuardGroup: sgg_admin
sfGuardPermission: sgp_admin
sfGuardUserGroup:
sgug_admin:
sfGuardGroup: sgg_admin
sfGuardUser: sgu_admin
So if someone could save me ...
[Updated on: Tue, 26 January 2010 09:10]
|
|
|
|
|
|
| Re: sfDoctrineGuardPlugin - Error during data-load [message #92103 is a reply to message #92047 ] |
Sun, 24 January 2010 11:15   |
tomor Messages: 110 Registered: December 2009 |
Senior Member |
|
|
|
Didn't you use the "symfony doctrine:build-schema" task? If so you have now in your project schema.yml the sfDoctrineGuardPlugin tables configuration and this is the problem.
[Updated on: Sun, 24 January 2010 11:16]
|
|
|
| Re: sfDoctrineGuardPlugin - Error during data-load [message #92139 is a reply to message #92103 ] |
Mon, 25 January 2010 09:15   |
Choup Messages: 9 Registered: January 2010 Location: France |
Junior Member |
|
|
| tomor | Didn't you use the "symfony doctrine:build-schema" task?
|
I use this task.
I do these tasks :
symfony doctrine:build-schema
symfony doctrine:build-model
symfony doctrine:build-sql
symfony doctrine:insert-sql
(before my problem)
| hasc | hm sorry, as i said i never worked with symfony
|
No problem, thanks for your try =)
Edit :
It look like the first letter have to be a capital letter :
sfGuardUser:
sgu_admin:
username: admin
password: admin
is_super_admin: true
personne:
pers_1:
nom: girousse
prenom: simeon
SfGuardUser: sgu_admin
sfGuardPermission:
sgp_admin:
name: admin
description: Administrator permission
sfGuardUserGroup:
sgug_admin:
SfGuardGroup: sgg_admin
SfGuardUser: sgu_admin
sfGuardGroup:
sgg_admin:
name: admin
description: Administrator group
sfGuardGroupPermission:
sggp_admin:
SfGuardGroup: sgg_admin
SfGuardPermission: sgp_admin
Now the data are correctly saved except for the sfGuardGroupPermission, and i've an error :
>> doctrine Loading data fixtures from "/hom...eon/Intranet-CCTB/data/fixtures"
>> doctrine Loading data fixtures from "/hom...ctrineGuardPlugin/data/fixtures"
Unknown record property / related component "sf_guard_user" on "sfGuardUserGroup"
The sfGuardUser link seems to work well in my table 'personne' but not with 'sf_guard_group_permission' ...
[Updated on: Mon, 25 January 2010 11:55]
|
|
|
|
|
|
| Re: sfDoctrineGuardPlugin - Error during data-load [message #92163 is a reply to message #92160 ] |
Mon, 25 January 2010 14:39   |
Choup Messages: 9 Registered: January 2010 Location: France |
Junior Member |
|
|
| tomor | Ok, try to run symfony doctrine:build --all --and-load --no-confirmation task.
|
Almost ok ^^'
Everything look to work, but if i had a 'personne' in my sfGuard.yml, te link is not found.
And why the ./symfony doctrine:data-load task doesn't work, but ./symfony doctrine:build --all --and-load --no-confirmation yes ? i have miss something ?
So that are my files :
(i've spoil them because there are a little too long for a post)
Toggle Spoiler
config/doctrine/schema.yml
Action:
connection: doctrine
tableName: action
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: false
intitule:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
module_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Module:
local: module_id
foreign: id
type: one
Adresse:
connection: doctrine
tableName: adresse
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
ville_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
personne_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
groupe_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
rue:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
rue_cptl:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
cp:
type: string(5)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
ville:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Groupe:
local: groupe_id
foreign: id
type: one
Personne:
local: personne_id
foreign: id
type: one
Ville:
local: ville_id
foreign: id
type: one
ContactPro:
connection: doctrine
tableName: contactPro
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
personne_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
groupe_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
fonction_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Fonction:
local: fonction_id
foreign: id
type: one
Groupe:
local: groupe_id
foreign: id
type: one
Personne:
local: personne_id
foreign: id
type: one
Departement:
connection: doctrine
tableName: departement
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
nom:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Region:
local: region_id
foreign: id
type: one
Ville:
local: region_id
foreign: departement_id
type: many
Fax:
connection: doctrine
tableName: fax
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
personne_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
groupe_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
numero:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Groupe:
local: groupe_id
foreign: id
type: one
Personne:
local: personne_id
foreign: id
type: one
Fonction:
connection: doctrine
tableName: fonction
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
intitule:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
ContactPro:
local: id
foreign: fonction_id
type: many
Groupe:
connection: doctrine
tableName: groupe
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
parent_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
type_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
intitule:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
description:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Type:
local: type_id
foreign: id
type: one
Adresse:
local: id
foreign: groupe_id
type: many
ContactPro:
local: id
foreign: groupe_id
type: many
Fax:
local: id
foreign: groupe_id
type: many
Mail:
local: id
foreign: groupe_id
type: many
Telephone:
local: id
foreign: groupe_id
type: many
Mail:
connection: doctrine
tableName: mail
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
personne_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
groupe_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
email:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Groupe:
local: groupe_id
foreign: id
type: one
Personne:
local: personne_id
foreign: id
type: one
Module:
connection: doctrine
tableName: module
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: false
nom:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Action:
local: id
foreign: module_id
type: many
Personne:
connection: doctrine
tableName: personne
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
nom:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
prenom:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
civ:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
date_naissance:
type: date(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
photo:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
sf_guard_user_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Adresse:
local: id
foreign: personne_id
type: many
ContactPro:
local: id
foreign: personne_id
type: many
Fax:
local: id
foreign: personne_id
type: many
Mail:
local: id
foreign: personne_id
type: many
Telephone:
local: id
foreign: personne_id
type: many
Region:
connection: doctrine
tableName: region
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
nom:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Departement:
local: id
foreign: region_id
type: many
Telephone:
connection: doctrine
tableName: telephone
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
personne_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
groupe_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
numero:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Groupe:
local: groupe_id
foreign: id
type: one
Personne:
local: personne_id
foreign: id
type: one
Type:
connection: doctrine
tableName: type
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
libelle:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Groupe:
local: id
foreign: type_id
type: many
Ville:
connection: doctrine
tableName: ville
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
departement_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
nom:
type: string(45)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Departement:
local: departement_id
foreign: region_id
type: one
Adresse:
local: id
foreign: ville_id
type: many
plugins/sfDoctrineGuardPlugin/config/doctrine/schema.yml
sfGuardGroup:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
unique: true
description: string(1000)
relations:
users:
class: sfGuardUser
refClass: sfGuardUserGroup
local: group_id
foreign: user_id
foreignAlias: Groups
permissions:
class: sfGuardPermission
local: group_id
foreign: permission_id
refClass: sfGuardGroupPermission
foreignAlias: Groups
sfGuardPermission:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
unique: true
description: string(1000)
sfGuardGroupPermission:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
group_id:
type: integer(4)
primary: true
permission_id:
type: integer(4)
primary: true
relations:
sfGuardGroup:
local: group_id
onDelete: CASCADE
sfGuardPermission:
local: permission_id
onDelete: CASCADE
sfGuardUser:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
username:
type: string(128)
notnull: true
unique: true
algorithm:
type: string(128)
default: sha1
notnull: true
salt: string(128)
password: string(128)
is_active:
type: boolean
default: 1
is_super_admin:
type: boolean
default: false
last_login:
type: timestamp
indexes:
is_active_idx:
fields: [is_active]
relations:
groups:
class: sfGuardGroup
local: user_id
foreign: group_id
refClass: sfGuardUserGroup
foreignAlias: Users
permissions:
class: sfGuardPermission
local: user_id
foreign: permission_id
refClass: sfGuardUserPermission
foreignAlias: Users
sfGuardUserPermission:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer(4)
primary: true
permission_id:
type: integer(4)
primary: true
relations:
sfGuardUser:
local: user_id
onDelete: CASCADE
sfGuardPermission:
local: permission_id
onDelete: CASCADE
sfGuardUserGroup:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer(4)
primary: true
group_id:
type: integer(4)
primary: true
relations:
sfGuardUser:
local: user_id
onDelete: CASCADE
sfGuardGroup:
local: group_id
onDelete: CASCADE
sfGuardRememberKey:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
user_id:
type: integer(4)
remember_key: string(32)
ip_address:
type: string(50)
primary: true
relations:
sfGuardUser:
local: user_id
foreignAlias: RememberKeys
foreignType: one
onDelete: CASCADE
data/fixtures/sfGuard]sfGuardUser:
sgu_admin:
username: admin
password: admin
is_super_admin: true
personne:
p_admin:
nom: marc
prenom: lavoine
sfGuardUser: sgu_admin
sfGuardPermission:
sgp_admin:
name: admin
description: Administrator permission
sfGuardUserGroup:
sgug_admin:
sfGuardGroup: sgg_admin
sfGuardUser: sgu_admin
sfGuardGroup:
sgg_admin:
name: admin
description: Administrator group
sfGuardGroupPermission:
sggp_admin:
sfGuardGroup: sgg_admin
sfGuardPermission: sgp_admin
In plugins/sfDoctrineGuardPlugin/data/fixtures/, i have fixtures.yml.sample (sfGuard.yml is a copy of this file, without 'personne' ...)
|
|
|
|
|
|
|
|
|
|
| Re: [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #95624 is a reply to message #92047 ] |
Wed, 17 March 2010 13:47   |
Tanatiel Messages: 9 Registered: March 2010 Location: Nantes (France) |
Junior Member |
|
|
This solution does not work even with "Groups" instead of "groups".
Here is my schema.yml from the sfDoctrineGuard Plugin
sfGuardGroup:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
unique: true
description: string(1000)
relations:
users:
class: sfGuardUser
refClass: sfGuardUserGroup
local: group_id
foreign: user_id
foreignAlias: Groups
permissions:
class: sfGuardPermission
local: group_id
foreign: permission_id
refClass: sfGuardGroupPermission
foreignAlias: Groups
sfGuardPermission:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
unique: true
description: string(1000)
sfGuardGroupPermission:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
group_id:
type: integer(4)
primary: true
permission_id:
type: integer(4)
primary: true
relations:
sfGuardGroup:
local: group_id
onDelete: CASCADE
sfGuardPermission:
local: permission_id
onDelete: CASCADE
sfGuardUser:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
username:
type: string(128)
notnull: true
unique: true
algorithm:
type: string(128)
default: sha1
notnull: true
salt: string(128)
password: string(128)
is_active:
type: boolean
default: 1
is_super_admin:
type: boolean
default: false
last_login:
type: timestamp
indexes:
is_active_idx:
fields: [is_active]
relations:
groups:
class: sfGuardGroup
local: user_id
foreign: group_id
refClass: sfGuardUserGroup
foreignAlias: Users
permissions:
class: sfGuardPermission
local: user_id
foreign: permission_id
refClass: sfGuardUserPermission
foreignAlias: Users
sfGuardUserPermission:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer(4)
primary: true
permission_id:
type: integer(4)
primary: true
relations:
sfGuardUser:
local: user_id
onDelete: CASCADE
sfGuardPermission:
local: permission_id
onDelete: CASCADE
sfGuardUserGroup:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer(4)
primary: true
group_id:
type: integer(4)
primary: true
relations:
sfGuardUser:
local: user_id
onDelete: CASCADE
sfGuardGroup:
local: group_id
onDelete: CASCADE
sfGuardRememberKey:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
user_id:
type: integer(4)
remember_key: string(32)
ip_address:
type: string(50)
primary: true
relations:
sfGuardUser:
local: user_id
foreignAlias: RememberKeys
foreignType: one
onDelete: CASCADE
I really don't get what's wrong...
[Updated on: Wed, 17 March 2010 16:42]
|
|
|
|
|
|
|
| Re: [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #95930 is a reply to message #95670 ] |
Mon, 22 March 2010 10:06   |
Tanatiel Messages: 9 Registered: March 2010 Location: Nantes (France) |
Junior Member |
|
|
Here is the .yml I've tried (my schema.yml does not include anything about sfGuardUser, I let the plugin define averything)
sfGuardPermission:
pEcoles:
name: ecoles
pBillets:
name: billets
pImportEcoles:
name: import_ecoles
sfGuardGroup:
gGroupeScolaire:
name: groupe_scolaire
sfGuardGroupPermission:
gp1:
SfGuardGroup: gGroupeScolaire
SfGuardPermission: pEcoles
gp2:
SfGuardGroup: gGroupeScolaire
SfGuardPermission: pBillets
gp3:
SfGuardGroup: gGroupeScolaire
SfGuardPermission: pImportEcoles
sfGuardUser:
toto:
username: toto
password: t0t0
Titi:
username: titi
password: t1t1
Tata:
username: tata
password: t4t4
groups: [gGroupeScolaire]
And this the error I get:
Unknown record property / related component "groups" on sfGuardUser
If it can help, using symfony doctrine:build --all --and-load does not cause any problem (but the relations tables need need to begin with "sf" and not "Sf" to work)
[Updated on: Mon, 22 March 2010 10:24]
|
|
|
|
|
|
| Re: [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #96059 is a reply to message #92047 ] |
Tue, 23 March 2010 17:39   |
Tanatiel Messages: 9 Registered: March 2010 Location: Nantes (France) |
Junior Member |
|
|
Ok, a night of rest, and things go better. At least , I know why I had the last error: I had a .yml in a subdirectory.
I moved it and I retried my tests.
Here is the schema.yml from sfDoctrineGuardPlugin:
sfGuardGroup:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
unique: true
description: string(1000)
relations:
users:
class: sfGuardUser
refClass: sfGuardUserGroup
local: group_id
foreign: user_id
foreignAlias: Groups
permissions:
class: sfGuardPermission
local: group_id
foreign: permission_id
refClass: sfGuardGroupPermission
foreignAlias: Groups
sfGuardPermission:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
name:
type: string(255)
unique: true
description: string(1000)
sfGuardGroupPermission:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
group_id:
type: integer(4)
primary: true
permission_id:
type: integer(4)
primary: true
relations:
sfGuardGroup:
local: group_id
onDelete: CASCADE
sfGuardPermission:
local: permission_id
onDelete: CASCADE
sfGuardUser:
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
username:
type: string(128)
notnull: true
unique: true
algorithm:
type: string(128)
default: sha1
notnull: true
salt: string(128)
password: string(128)
is_active:
type: boolean
default: 1
is_super_admin:
type: boolean
default: false
last_login:
type: timestamp
indexes:
is_active_idx:
fields: [is_active]
relations:
groups:
class: sfGuardGroup
local: user_id
foreign: group_id
refClass: sfGuardUserGroup
foreignAlias: Users
permissions:
class: sfGuardPermission
local: user_id
foreign: permission_id
refClass: sfGuardUserPermission
foreignAlias: Users
sfGuardUserPermission:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer(4)
primary: true
permission_id:
type: integer(4)
primary: true
relations:
sfGuardUser:
local: user_id
onDelete: CASCADE
sfGuardPermission:
local: permission_id
onDelete: CASCADE
sfGuardUserGroup:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
user_id:
type: integer(4)
primary: true
group_id:
type: integer(4)
primary: true
relations:
sfGuardUser:
local: user_id
onDelete: CASCADE
sfGuardGroup:
local: group_id
onDelete: CASCADE
sfGuardRememberKey:
options:
symfony:
form: false
filter: false
actAs: [Timestampable]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
user_id:
type: integer(4)
remember_key: string(32)
ip_address:
type: string(50)
primary: true
relations:
sfGuardUser:
local: user_id
foreignAlias: RememberKeys
foreignType: one
onDelete: CASCADE
Here is my test file:
sfGuardPermission:
pEcoles:
name: ecoles
pBillets:
name: billets
pImportEcoles:
name: import_ecoles
sfGuardGroup:
gGroupeScolaire:
name: groupe_scolaire
sfGuardUser:
toto:
username: toto
password: t0t0
Titi:
username: titi
password: t1t1
Tata:
username: tata
password: t4t4
Groups: [ gGroupeScolaire ]
SfGuardGroupPermission:
gp1:
SfGuardGroup: gGroupeScolaire
SfGuardPermission: pEcoles
gp2:
SfGuardGroup: gGroupeScolaire
SfGuardPermission: pBillets
gp3:
SfGuardGroup: gGroupeScolaire
SfGuardPermission: pImportEcoles
It gave me the error
Unknown record property / related component "groups" on "sfGuardUser"
I tried with "groups" instead of "Groups", same result.
So I remove the "groups" line and added this at the end of the file:
SfGuardUserGroup:
ug1:
SfGuardGroup: gGroupeScolaire
sfGuardUser: toto
which threw this error:
Unknown record property / related component "sfguarduser" on "sfGuardUserGroup"
And if I use sfGuardUser instead of SfGuardUser in the last line, the error becomes:
Unknown record property / related component "sf_guard_user" on "sfGuardUserGroup"
And it looks like doctrine:data-load truncates the tables.
[Updated on: Tue, 23 March 2010 17:39]
|
|
|
|
|
|
|
| Re: [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #96106 is a reply to message #96102 ] |
Wed, 24 March 2010 12:20   |
tomor Messages: 110 Registered: December 2009 |
Senior Member |
|
|
| Tanatiel wrote on Wed, 24 March 2010 11:48 | Here is the setUp() function from BaseSfGuardUser.class.php in /lib/model/doctrin/base
.......
|
Is your path of the BaseSfGuardUser.class.php
/lib/model/doctrin/base
or
/lib/model/doctrine/sfDoctrineGuardPlugin/base
?
[Updated on: Wed, 24 March 2010 12:53]
|
|
|
|
| Re: [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #96133 is a reply to message #92047 ] |
Wed, 24 March 2010 16:13   |
Tanatiel Messages: 9 Registered: March 2010 Location: Nantes (France) |
Junior Member |
|
|
I'll try a rebuild and I checked my directories and...surprise!
BaseSfGuardUser exists in both /lib/model/doctrine/base and /lib/model/doctrine/sfDoctrineGuardPlugin/base !
My schema.yml from /config/doctrine does not redefine anything from the plugin, it only contains the definitions of my own tables.
I think I will clear /lib/model/doctrine/base by the hand and try a rebuild, things should be better after...if the build task does not rebuild BaseSfGuardUser in two directories!
Here is the content of my /lib/model/doctrine/sfDoctrineGuardPlugin/base/BaseSfGuardUs er.class.php
public function setUp()
{
parent::setUp();
$this->hasMany('sfGuardGroup as groups', array(
'refClass' => 'sfGuardUserGroup',
'local' => 'user_id',
'foreign' => 'group_id'));
$this->hasMany('sfGuardPermission as permissions', array(
'refClass' => 'sfGuardUserPermission',
'local' => 'user_id',
'foreign' => 'permission_id'));
$this->hasMany('sfGuardUserPermission', array(
'local' => 'id',
'foreign' => 'user_id'));
$this->hasMany('sfGuardUserGroup', array(
'local' => 'id',
'foreign' => 'user_id'));
$this->hasOne('sfGuardRememberKey as RememberKeys', array(
'local' => 'id',
'foreign' => 'user_id'));
$timestampable0 = new Doctrine_Template_Timestampable();
$this->actAs($timestampable0);
}
It is far more coherent.
BRB!
|
|
|
| Re: [SOLVED] sfDoctrineGuardPlugin - Error during data-load [message #96134 is a reply to message #96133 ] |
Wed, 24 March 2010 16:19  |
Tanatiel Messages: 9 Registered: March 2010 Location: Nantes (France) |
Junior Member |
|
|
I've tried a doctrine:build --all-classes task and after I found BaseSfUserGuard in both directories as before. Here is my schema.yml from config/doctrine:
Mairie:
columns:
nom: { type: string(50), notnull: true, unique: true }
email: { type: string(50), notnull: true }
Ecole:
actAs: { Timestampable: ~ }
columns:
code: { type: string(20), notnull: true, unique: true, primary: true}
password: { type: string(20), notnull: true}
nom: { type: string(30), notnull: true}
type_etab: { type: enum, values: [E,P,M] }
mairie_id: { type: integer, notnull: true }
email: { type: string(50), notnull: true }
adresse1: { type: string(35), notnull: true }
adresse2: { type: string(35) }
cp: { type: int(5), notnull: true }
ville: { type: string(100), notnull: true }
is_active: { type: boolean, default: 1 }
nb_trials: { type: integer, default: 0 }
indexes:
is_active_idx:
fields: [is_active]
relations:
Mairie: { local: mairie_id, foreign: id, foreignAlias: Ecoles }
MotifDepl:
columns:
libelle: { type: string(50), notnull: true }
Billet:
actAs:
Timestampable:
updated:
disabled: true
columns:
numero: { type: integer, primary: true, autoincrement: true }
etab_code: { type: string(20), notnull: true }
resp_civ: { type: string(4), notnull: true }
resp_nom: { type: string(100), notnull: true }
resp_prenom: { type: string(50), notnull: true }
nb_eleves: { type: tinyint(2), notnull: true }
nb_accomp: { type: tinyint(2), notnull: true }
date_depl: { type: timestamp, notnull: true }
trajet: { type: tinyint(1), notnull: true }
motifdepl_id: { type: integer, notnull: true }
relations:
Ecole: { local: etab_code, foreign: code, foreignAlias: Billets }
MotifDepl: { local: motifdepl_id, foreign: id, foreignAlias: Billets }
ExportMairie:
actAs:
Timestampable:
updated:
disabled: true
columns:
mairie_id: { type: integer, notnull: true }
periode_deb: { type: timestamp, notnull: true }
periode_fin: { type: timestamp, notnull: true }
fichierXLS: { type: string(150), notnull: true }
fichierPDF: { type: string(150), notnull: true }
relations:
Mairie: { local: mairie_id, foreign: id, foreignAlias: Exports }
As you can see, there is no redifinition of sfGuardUser or any other table from the plugin...so why happens with the build task?
[edit]
Ok, I cleaned /lib/model/doctrine/base by the hand and the sfGuard classes did not come back after a build. I'll try my data-load now. I'll keep in touch, pfiuuuuu
[edit 2]
Ok, I tried the data-load and it worked well with "sf" prefix.
I'll make some trials with doctrine:build --all --and-load to be sure.
Thanks a lot for your help!
[Updated on: Wed, 24 March 2010 16:35]
|
|
|