flokosiol / kirby-focus

Better image cropping for Kirby CMS
184 stars 14 forks source link

Deprecated method #47

Closed HashandSalt closed 4 years ago

HashandSalt commented 4 years ago

Plugin throws the following issue when using focusSrcset in a template or controller:

 Whoops \ Exception \ ErrorException (E_DEPRECATED)
Non-static method Flokosiol\Focus::focusSrcset() should not be called statically

The line in the plugin causing it is line 70:

        'focusSrcset' => function ($sizes = null) {
            return Flokosiol\Focus::focusSrcset($this, $sizes);
        },

Observed in Kirby 3.3.2 running on PHP 7.2

flokosiol commented 4 years ago

Thanks for reporting. Line 165 in src/Focus.php might cause this issue. Changing it to public static function … should do the trick.

I’ve no access to my computer right now. Would you mind test it yourself?

flokosiol commented 4 years ago

Just found out, that I can edit on my phone. But I still need to create a new release. To be continued … :)

HashandSalt commented 4 years ago

Yes, the fix seems to work ok :) 👍

flokosiol commented 4 years ago

Perfect. Thanks for testing.

flokosiol commented 4 years ago

Created version 3.0.4 with the fix.