Form content with wire:model inside modal is not being loaded when using hasMany items, whereas without it works without problems #7272
Unanswered
hooft99
asked this question in
7. Bugs (archived)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Livewire version
v3.1.0
Which PHP version are you using?
PHP 8.2
Repository URL
No response
Steps To Reproduce
Watch video, this demonstrates the issue: https://youtu.be/C-Oy9adrj30
I have used this method in many project in livewire v2 without any problems. I also downgraded my version to v2 to check if the issue was resolved there, and it was.
The issue in writing: I have a form that I fill in with a hasMany relationship. The form is opened from an index livewire controller. The first time it loads the page and I click on edit, the modal opens and the form fields are filled. I then close the modal and cleanup all variables in the form livewire controller. I then click on edit once again, and only the hasMany relationship is loaded. The variables from the main model are not filled in the form. The Laravel debug bar shows the request and that request shows that the data was indeed fetched. Also when showing the variable directly without wire:model it shows the correct value for the variable. I also have the same form without the hasMany relationship and there is no issue there.
Hopefully there is a fix available for this problem.
Code used (index Livewire controller):
Code used (form Livewire controller):
Code on form page:
Code used on page shown by default controller:
@livewire('management.category.index') shows the table in the index and calls wire:click to the index livewire controller which starts the showItem($itemID, $edit) function, with the required parameters.
Additional information
No response
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions