awcodes / filament-curator

A media picker plugin for Filament Panels.
MIT License
324 stars 86 forks source link

It no longer respects my directory directive #356

Closed Askancy closed 9 months ago

Askancy commented 10 months ago

Filament Version

v3.0.102

Plugin Version

v3.1.4

PHP Version

PHP8.2.12

Problem description

Since I updated the package, it no longer respects my directory directive... has there been any update?

Expected behavior

show the images of the indicated folder

Steps to reproduce

CuratorPicker::make('immagine')
    ->buttonLabel('Pick Image')
    ->color('primary')
    ->directory(function (Get $get) {
        return $get('gioco_principale') ?? '0';
    })
    ->orderColumn('order'),
Select::make('gioco_principale')
    ->label('Gioco Principale')
    ->relationship('giochi', 'name')
    ->searchable()
    ->live(),

Reproduction repository

No response

Relevant log output

No response

awcodes commented 10 months ago

Since your use case requires relationships and reactive form fields, I'm sorry, but I'm going to need a reproduction repo to assist further on this.

Otherwise, you can lock down the version to the previous release which patched a fix to make the picker work correctly in modals.

Askancy commented 10 months ago

The problem occurs even if I give a folder explicitly, so the relationship is not guilty:

                                CuratorPicker::make('immagine')
                                    ->buttonLabel('Pick Image')
                                    ->color('primary')
                                    ->directory('2537')
                                    ->limitToDirectory()
                                    ->orderColumn('order'),

I downgraded to 3.1.1 and the code works perfectly without making any changes....

awcodes commented 10 months ago

I believe you're having issues, but without a reproduction repo there's no way I can set things up the same way they are in your app. Nor do I have time to even try.

Help me help you. Please.

awcodes commented 10 months ago

Custom directories, appears to be working for me.

Screenshot 2023-11-28 at 8 53 04 AM Screenshot 2023-11-28 at 8 53 09 AM

awcodes commented 9 months ago

Closing as stale.

Askancy commented 9 months ago

I did further testing and indeed Curator opens the right folder, however on the second try, here is a video:

https://github.com/awcodes/filament-curator/assets/789702/e9194a11-ea3d-450a-acd2-1e4cbf0d490e

Demo Online: https://dev.gamelite.it/admin Repo: https://github.com/Askancy/Demo-GECurator

The code I use is:

CuratorPicker::make('immagine')
    ->buttonLabel('Pick Image')
    ->color('primary')
    ->directory(function (Get $get) {
        return $get('gioco_principale') ?? '0';
    })
    ->limitToDirectory()
    ->orderColumn('order'),

Also, the gallery that Curator opens for the first time is not even from the ID 0 folder, I don't understand by what criteria it shows those images.