Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when populating field after populating the form with object #33

Closed
florentpoujol opened this issue Dec 4, 2012 · 3 comments
Closed
Labels
Milestone

Comments

@florentpoujol
Copy link

When I populate a form from an Eloquent model then try to populate a field, I get the error :
"Cannot use object of type ObjectName as array".

I fixed it on my side by replacing the content of poulateField() by this :

if (is_object(static::$values)) {
      static::$values->$key = $value;
    }
    else {
      static::$values[$key] = $value;
    }

I am surprised this issue wasn't already discussed ?

@Anahkiasen
Copy link
Member

Yup, indeed there was a problem. Surprised too. Can you do a pull request of this ?

@florentpoujol
Copy link
Author

I guess but I never did this.
I just need to fork, made the fix, commit, then issue a pull request ?

@Anahkiasen
Copy link
Member

I think if I recall you can just go in the source of Former.php on Github, click the Edit button and it will automatically create a fork and allow you to make a PR after that. If I remember correctly. Really sorry, I'm just kind of cramped at work

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

No branches or pull requests

2 participants