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

[Bug]: Data not passing #87

Closed
iRaziul opened this issue Feb 19, 2024 · 6 comments
Closed

[Bug]: Data not passing #87

iRaziul opened this issue Feb 19, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@iRaziul
Copy link

iRaziul commented Feb 19, 2024

What happened?

I found a serious but weird issue. 🫨

My models are Category and Product where the category has child categories.

I used this code to select a category for the product and this was working fine but for the last couple of days it is not working as expected.

SelectTree::make('category_id')
    ->label('Category')
    ->required()
    ->relationship('category', 'name', 'parent_id')
    ->defaultOpenLevel(5)
    ->placeholder('Select category'),

This renders the field as I wanted:
image

I've selected the category and submitted the form but got this response:
image

How to reproduce the bug

SelectTree::make('category_id')
    ->label('Category')
    ->required()
    ->relationship('category', 'name', 'parent_id')
    ->defaultOpenLevel(5)
    ->placeholder('Select category'),

Package Version

3.1.32

PHP Version

8.2

Laravel Version

10.4

Which operating systems does with happen with?

Windows, Linux

Notes

I can provide you the website link privately so that you can have a look.

@iRaziul iRaziul added the bug Something isn't working label Feb 19, 2024
@CodeWithDennis
Copy link
Owner

This might have to do with the same issue (#85) @saade

@iRaziul Could you check if dehydrated(true) fixes it?

@iRaziul
Copy link
Author

iRaziul commented Feb 19, 2024

This might have to do with the same issue (#85) @saade

@iRaziul Could you check if dehydrated(true) fixes it?

Yeah it seems like working after using dehydrated()

@Sjoerd24
Copy link

Sjoerd24 commented Feb 27, 2024

I have the same problem, data is not on any field passing through. Is the mentioned fixed above a def fix or is a better solution coming along? Bit weird that all selecttree fields aren't working anymore in my site, luckly still in testing fase. :)

edit: ->dehydrated(true) fixes also my problem. But this shouldn't be standard behaviour right?

@saade
Copy link
Contributor

saade commented Feb 27, 2024

#89

@CodeWithDennis
Copy link
Owner

CodeWithDennis commented Feb 27, 2024

#89

Merged, please check your application with the latest version. @Sjoerd24

@Sjoerd24
Copy link

@CodeWithDennis Thanks, it all works now again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants