mullema / k3-image-clip

Visually crop images with a handy image editor directly inside the panel
MIT License
40 stars 4 forks source link

3.8 Compatibility #25

Closed mullema closed 1 year ago

mullema commented 1 year ago

The model object must use the "Kirby\Filesystem\IsFile" trait in file: ...\Codebase\kirby\src\Filesystem\File.php line: 448

afbora commented 1 year ago

Could you share your extending method please?

mullema commented 1 year ago

Hi @afbora, not sure what you mean.

That's the extended class. https://github.com/mullema/k3-image-clip/blob/master/classes/File.php

<?php

namespace mullema;

use Kirby\Cms;

class File extends Cms\File {
afbora commented 1 year ago

@lukasbestle, class_uses only returns traits of the current class. This error occurs because the extended class does not include its traits. Do you have an idea for a more comprehensive solution?

https://github.com/getkirby/kirby/blob/3.8.0-rc.2/src/Filesystem/File.php#L447-L449

lukasbestle commented 1 year ago

@afbora I see three possible solutions:

distantnative commented 1 year ago

@lukasbestle @afbora I'd go for the latter - interface would be clean but then again all plugins would need to implement the interface and first will have breaking change errors. I think checking for those two methods would be sufficient and the least painful way right now.

lukasbestle commented 1 year ago

I have created an issue in the Kirby repo: https://github.com/getkirby/kirby/issues/4748 This issue can IMO be closed as it's not an issue in the plugin code but an regression in Kirby.

mullema commented 1 year ago

Thx