lukas-frey / filament-icon-picker

An icon picker field for Filament
MIT License
101 stars 20 forks source link

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

Closed malle-pietje closed 9 months ago

malle-pietje commented 9 months 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 9 months 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 9 months ago

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

atmonshi commented 9 months ago

try delete the vendor and reinstall, just to make sure

malle-pietje commented 9 months 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 9 months ago

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

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

Apologies for the noise!