Closed mullema closed 1 year ago
Could you share your extending method please?
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 {
@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
@afbora I see three possible solutions:
class_parents()
and check each parent class if it uses the trait.root
and url
methods.@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.
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.
Thx
The model object must use the "Kirby\Filesystem\IsFile" trait in file: ...\Codebase\kirby\src\Filesystem\File.php line: 448