Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Fail to save data because of missing bind #8

Closed
tomws opened this issue Jun 17, 2010 · 4 comments
Closed

Fail to save data because of missing bind #8

tomws opened this issue Jun 17, 2010 · 4 comments

Comments

@tomws
Copy link

tomws commented Jun 17, 2010

I had an issue getting data saved using Permissionable. Using a sandbox of the manual's ACL-controlled application on a 1.3.2 core, and after changing some names used by Permissionable (http://github.com/jmcneese/permissionable/issues/#issue/7), the add operation failed with the error:

Undefined property: Post::$PostPermission [APP\plugins\permissionable\models\behaviors\permissionable.php, line 205]

I think that means the Permissionable model/behavior isn't correctly associated to the calling model in the afterSave method. I tested this idea by adding $this->bind($Model); before the several potential calls to _ $Model->{$alias}->*. (I put mine on line 202.) Data then saved correctly.

@sambernard
Copy link

I had to do this as well to make it work.

@t73biz
Copy link
Contributor

t73biz commented Apr 15, 2011

I had the same issue. However, to clarify, I had to use $this->_bind($Model); Notice the _ before bind as $this->bind is a non-existant call for $this

HTH those stuck with this issue.

@jmcneese
Copy link
Owner

i'll be releasing an updated version with this fix. in the meantime, feel free to fork and send me pull requests with this fix committed and i'll attribute it to you.

@jmcneese
Copy link
Owner

fixed in b9d799c

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants