-
Notifications
You must be signed in to change notification settings - Fork 915
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
[Bug] Update 5.0.15 to 5.0.16 (and after) - Impossible to save/create #4381
Comments
Hello @KevinCassier I will need some more information to work with here. In what file the error is triggered ? Can you post the full error stacktrace ? Cheers |
Also, if it only happens when |
Here is a full stack trace. I was unable to replicate on my dev, but production version gives this error. production.ERROR: Call to a member function get() on array {"userId":2,"exception":"[object] (Error(code: 0): Call to a member function get() on array at /var/www/vendors/vendors-portal/vendor/backpack/crud/src/app/Http/Controllers/Operations/UpdateOperation.php:98) |
Well, the only place where we use Could that be the problem ? |
This is possible yes. It is most probably related to modifying relations, maybe unsetting a relation could be the culprit. I will try to test and investigate more. But this has been working ok on 5.0.14 at least. |
Hi @pxpm, Here is the trace of the error
And here is the example of my overidding update/store functions : public function update() public function store() And all this work fine in 5.0.15 And not in 5.0.16 and after Thanks for your help and your amazing job btw! |
I also had this issue when updating to 5.0.16, again I override the update and store methods. I believe I tracked it down to the getStrippedSaveRequest($request) call in the update and store functions of UpdateOperation and CreateOperation traits. |
Hi, I confirm I have this problem too. Used to work before, don't know since which update it broke. Even with nothing in the update or store function: Error "Call to a member function only() on array"
Edited: I confirm that happens on 5.0.18, downgraded to 5.0.14 and it works fine |
I am still unable to replicate this, please have a look to see if I am doing something different from you guys: https://recordit.co/XxlnOBtibc |
I have just upgraded to 5.0.19 to test again. I have tested on a model where I don't even override the store operation and am now getting the error below.
originating from the getStrippedSaveRequest function inside Fields.php trait, which is the following line (472);
|
One other difference I can see to your demo is I am using CRUD::field (CrudPanelFacade) to define my fields, you are using $this->crud->addField, not sure if that's making a difference? I think this is it, after changing the fields to use $this->crud->addField() $request is back to being a Request and not an array. |
Hey, i have the same error, and for me it was because of a relationship field with a belongsToMany relation. Here is the field :
Here is my relation :
I have another relationship field with a hasMany relation and he is working fine. Downgraded to 5.0.14 and everything is working fine again. If you need more information, feel free to reach me :) |
This isn't the issue for me, I have no |
This comment stood out for me and I investigated a little further as we had previous issues with defining fields as array or fluently. I found out an inconsistency when defining I didn't get the error you got with You can see what I've found and the fix here: #4438 |
Will review and merge, thank you @pxpm ! Everybody else - quick question. Did everybody here upgrade from v4.1 to v5? Or using a fresh project with v5? I'm wondering if you guys aren't missing an upgrade step or something. Thank you! |
I did upgrade from v4.1 to v5.0. Which upgrade step are you referring to? |
Mine was direct 5 install.
…On Tue, Jun 14, 2022, 21:21 ale1981 ***@***.***> wrote:
I did upgrade from v4.1 to v5.0. Which upgrade step are you referring to?
—
Reply to this email directly, view it on GitHub
<#4381 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABI3ROFFSEK7TFV2NGNBD3VPDERRANCNFSM5WFAVIKQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I started from the 5 directly me too (with pro add-on) |
Damn it! Ok then, I don't see how we can debug this further, other than jumping into a call. Is any of you willing to do a quick call, please, so we can help debug in your particular project, and see where it breaks? It's win-win, I think. If so, please let us know with an email at [email protected] - I'll tag Pedro along so we can coordinate. Thanks! |
Hey everybody, Thank you for your patience on this 🙏 Thanks to a meeting with @cdo9 (thanks again Christophe!), @pxpm was able to finally get to the bottom of this and create PR #4459 . We've just merged it & tagged 5.1.2, which has this fix. So please run a Of course, let us know if it doesn't, and we'll reopen. |
Bug report
What I did
I updated from 5.0.15 to 5.0.16, and just try to create / or update an entity.
What I expected to happen
My entity is saved.
What happened
It doesn't work and I have an error like
What I've already tried to fix it
Impossible to find why.
The only thing I noticed is that only on a model which extend the update/store method (with an traitStore/traitUpdate inside)
The error occur when $response = $this->traitStore() or $response = $this->traitUpdate() is call
Is it a bug in the latest version of Backpack?
Yes
Thanks for you help
The text was updated successfully, but these errors were encountered: