whitecube / nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova
MIT License
790 stars 234 forks source link

[BUG?] Submitting action modal generates an error #74

Open skoyah opened 5 years ago

skoyah commented 5 years ago

I am not sure if this is a bug or something that I am missing on my end.

I've followed up the documentation to create a flexible content and when I try to submit the modal It returns this error on the console:

Screenshot 2019-09-09 at 10 32 01

Here is the flexible content on a custom action:

Screenshot 2019-09-09 at 11 41 15

Here is my action modal:

Screenshot 2019-09-09 at 11 43 16

Is there anything else that I need to do on my end?

voidgraphics commented 5 years ago

What version of Nova are you using?

Your code looks fine to me. Pretty sure if it displays correctly in the page it means you've done everything you had to, so this must be a bug, an incompatible Nova version or another Nova package messing with things.

skoyah commented 5 years ago

My Nova version is the latest one.

skoyah commented 5 years ago

Correction: Nova v.2.1.0

voidgraphics commented 5 years ago

Oh, it just dawned on me that you're inside a modal. Can't say we've tested that functionality, in fact I'm not familiar with it at all. We've only tested this as a regular field on nova resources. This must be why you're having this problem. Could you give some more specifics on your setup?

voidgraphics commented 5 years ago

Nevermind, I understand now. These modals are actions. I've never used actions so I did not recognise that. Definitely seems like a bug.

skoyah commented 5 years ago

Basically, I want to be able to use this package on a custom action. Currently, custom actions accept the default Nova fields, but maybe, like you are saying, this package might not work inside modals.

Basically, I have a resource with an action to generate records on another resource.

Do you think this feature could be implemented on modals easily?

We really would like to see this functionality! :)

voidgraphics commented 5 years ago

I couldn't tell you if it's easy or not - I would have to look deeper into it to know for sure. I don't have the possibility of doing that right now, but if you're feeling adventurous, it would be a great help if you could investigate the problem further. We'd love to get it working :)

skoyah commented 5 years ago

I couldn't tell you if it's easy or not - I would have to look deeper into it to know for sure. I don't have the possibility of doing that right now, but if you're feeling adventurous, it would be a great help if you could investigate the problem further. We'd love to get it working :)

I've never tried to create a custom field so I really do not know how the JS part works. Nevertheless I will try to deep into the package to see what is being done.

Thanks for your feedback mate! Hope we can get this feature to work soon! :)

skoyah commented 5 years ago

If anyone reading this has a good solution and wants to prove a PR I'll buy you a coffee! 😄 ☕️

skoyah commented 5 years ago

@voidgraphics I think I got it to work after spend a long time on debug mode! At least for action modals I can get the data now. Not sure If I broke something on normal usage. Can I make a PR so you can check it?