lukas-frey / filament-icon-picker

An icon picker field for Filament
MIT License
111 stars 22 forks source link

Still seeing the Guava\FilamentIconPicker\Forms\IconPicker::relationship error #15

Closed malle-pietje closed 1 year ago

malle-pietje commented 1 year ago

I'm running version 2.0.2 and seeing the Guava\FilamentIconPicker\Forms\IconPicker::relationship error. After changing the relationship() method to this the error goes away:

    public function relationship(Closure|string|null $name, Closure|string|null $titleAttribute = null, ?Closure $modifyQueryUsing = null): static
    {
        throw new \BadMethodCallException('Method not allowed.');
    }

Note the addition of = null to the second parameter.

Originally posted by @malle-pietje in https://github.com/LukasFreyCZ/filament-icon-picker/issues/13#issuecomment-1721115036

atmonshi commented 1 year ago

the $titleAttribute is = null, right?

your code this the same as the PR. are you sure you are on the last version?

malle-pietje commented 1 year ago

Well in my codebase that was missing when using 2.0.2... Not sure how that was possible though.

atmonshi commented 1 year ago

try delete the vendor and reinstall, just to make sure

malle-pietje commented 1 year ago

I now see what happened. PHPStorm had cached 2.0.2 as the version in the UI, but I had to set my "minimum-stability" to "dev" causing composer to load this dev version: image

Now the PHPStorm UI picked it up.

malle-pietje commented 1 year ago

Changed composer.json entry to this and all is good:

"guava/filament-icon-picker": "^2.0@stable",

Apologies for the noise!