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

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

User avatar
partnerscoop
Posts: 7
Joined: Sat Jul 23, 2011 12:17 pm
Location: Italia
Contact:

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

Postby partnerscoop » Thu Apr 23, 2015 10:26 am

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 157 times
employers.tar.gz
(8.85 KiB) Downloaded 143 times
User avatar
mdhart
Group-Office Developer
Group-Office Developer
Posts: 8
Joined: Tue Nov 25, 2014 4:06 pm

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

Postby mdhart » Thu Apr 23, 2015 2:23 pm

You probably have a Worker in your database that has no Employer assigned and therefore has no ACL
Regards,
Michael
User avatar
partnerscoop
Posts: 7
Joined: Sat Jul 23, 2011 12:17 pm
Location: Italia
Contact:

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

Postby partnerscoop » Thu Apr 23, 2015 3:02 pm

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?
_________________________________________________________________________
Best regards,

PartnersCoop Società Cooperativa
Massimiliano Chiodi
User avatar
partnerscoop
Posts: 7
Joined: Sat Jul 23, 2011 12:17 pm
Location: Italia
Contact:

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

Postby partnerscoop » Fri Apr 24, 2015 10:23 am

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;
       }
_________________________________________________________________________
Best regards,

PartnersCoop Società Cooperativa
Massimiliano Chiodi
User avatar
mdhart
Group-Office Developer
Group-Office Developer
Posts: 8
Joined: Tue Nov 25, 2014 4:06 pm

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

Postby mdhart » Mon May 04, 2015 3:05 pm

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
Regards,
Michael
User avatar
partnerscoop
Posts: 7
Joined: Sat Jul 23, 2011 12:17 pm
Location: Italia
Contact:

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

Postby partnerscoop » Wed Jun 10, 2015 4:56 pm

Excuse my ignorance, but how?
_________________________________________________________________________
Best regards,

PartnersCoop Società Cooperativa
Massimiliano Chiodi

Return to “Contributed development”

Who is online

Users browsing this forum: No registered users and 2 guests

cron