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

fix: model not implementing has media should only throw exception if no custom callback is provided #2494

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

Tofandel
Copy link
Contributor

@Tofandel Tofandel commented Feb 26, 2024

Description

It's very much possible to implement an Image column with a custom thumbnail (eg coming from youtube or any other service)

Right now the following throws an exception if the Video model doesn't use HasMedias

            Image::make()->field('thumbnail')->title('Thumbnail')
                ->customRender(fn(Video $video) => $video->getThumbnail(80, 80))

But it shouldn't because of the custom render method provided

BTW I noticed a related issue on the browser, using any other field name than thumbnail on image in the browser columns results in the image being displayed as text instead of as an image as well as the order of the columns being wrong

@ifox ifox merged commit 057554a into area17:3.x Feb 27, 2024
11 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants