You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change is not backwards compatible with this package. This is due to the override of the getAttributes() model method. If the attribute values aren't strings, the query builder can't bind them properly and you get an "Object could not be converted to string" message.
This looks like it's been in the EloquentTrait for quite a long time, since 86fd1db. What does overriding that method actually provide though? Doesn't the accessor for the field still exist?
Edit: Sorry I didn't bring this issue up in the laravel stapler repo, but this is the repo that contains the EloquentTrait class
I ended up using my own trait (which uses the EloquentTrait) to override the getAttributes method (and just return the parent version), but yours seems like a better solution!
Activity
austenc commentedon Aug 31, 2017
I've also opened an issue related to this here: laravel/framework#20902
PR: laravel/framework#20903
austenc commentedon Sep 1, 2017
Looks like this needs to be fixed in the package, removing the
getAttributes()method override will do it.czim commentedon Sep 2, 2017
I solved this problem in my own 'Stapler copycat' package this way:
czim/laravel-paperclip@515a66b
So far, so good, but if anyone has a nicer fix, I'd love to hear it.
austenc commentedon Sep 4, 2017
@czim Solid fix, thank you for sharing!
I ended up using my own trait (which uses the EloquentTrait) to override the
getAttributesmethod (and just return the parent version), but yours seems like a better solution!