Page 1 of 1

GO5, aclField() generates 'Could not find relational ACL'

Posted: Thu Apr 23, 2015 10:26 am
by partnerscoop
I adopted a "module" to create a list of employers, who want to connect a "module" to create a list of workers. When I try to connect the permission management between the two forms I get the following error: "Could not find relational ACL: employer.acl_id (employer) in GO_Workers_Model_Worker with pk: 0" .. Can anyone tell me where am I wrong?
Forum and blog I have not found anything significant. I state are a programmer very impractical.
workers.tar.gz
(6.62 KiB) Downloaded 214 times
employers.tar.gz
(8.85 KiB) Downloaded 205 times

Re: GO5, aclField() generates 'Could not find relational ACL'

Posted: Thu Apr 23, 2015 2:23 pm
by mdhart
You probably have a Worker in your database that has no Employer assigned and therefore has no ACL

Re: GO5, aclField() generates 'Could not find relational ACL'

Posted: Thu Apr 23, 2015 3:02 pm
by partnerscoop
The problem occurs when I try to insert the first Worker using the ADD button. it is clear that after creating the first employer, and before creating the first worker there are keys assigned. Can you suggest a solution?

Re: GO5, aclField() generates 'Could not find relational ACL'

Posted: Fri Apr 24, 2015 10:23 am
by partnerscoop
SOLVED
It was necessary to initialize the key inside the MODEL.

Code: Select all

	public function defaultAttributes() {
           $attr = parent::defaultAttributes();
           $attr['employer_id']=1;
           return $attr;
       }

Re: GO5, aclField() generates 'Could not find relational ACL'

Posted: Mon May 04, 2015 3:05 pm
by mdhart
That should work but it would give you an error when the Employer with ID 1 is deleted.
You might want to read this from the GET parameters or select the first valid ID from the employers table

Re: GO5, aclField() generates 'Could not find relational ACL'

Posted: Wed Jun 10, 2015 4:56 pm
by partnerscoop
Excuse my ignorance, but how?