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

When calling multiple CuratorPicker::make on the same for, the page crashes #241

Closed
matt-shirey opened this issue Jul 15, 2023 · 2 comments

Comments

@matt-shirey
Copy link

matt-shirey commented Jul 15, 2023

Whenever I add multiple CuratorPicker::make to my form, it causes the form to throw an error.

Code:

use Awcodes\Curator\Components\Forms\CuratorPicker;

CuratorPicker::make('thumbnail')
    ->label('Thumbnail Image')
    ->disk('local')
    ->directory('selections'),
CuratorPicker::make('main_image')
    ->label('Main Image')
    ->disk('local')
    ->directory('selections'),

Error:
Awcodes\Curator\Components\Forms\CuratorPicker::Awcodes\Curator\Components\Forms\{closure}(): Argument #2 ($state) must be of type array|int|null, string given, called in...

@awcodes
Copy link
Owner

awcodes commented Jul 15, 2023

One of your fields is returning a string instead of a media record or media record id. You'll need to debug further to see why that is.

@matt-shirey
Copy link
Author

@awcodes Thank you. I missed that the field had old data in it.

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

No branches or pull requests

2 participants