Skip to content

CuratorPicker does not display images when using DatePathGenerator #617

@informatJonas

Description

@informatJonas

Filament Version: 3.3.30
Plugin Version: 3.7.7
PHP Version: 8.3.23

Problem description
When using CuratorPicker with the DefaultPathGenerator, all previously uploaded images are displayed correctly in the picker. However, if you configure CuratorPicker to use DatePathGenerator, images uploaded using this generator do not appear in the picker, even though those images are stored in the database and exist in the correct directory.

Example Code:

With DefaultPathGenerator (images are shown):

CuratorPicker::make('image_id')
    ->relationship('image', 'id')
    ->multiple(false)
    ->directory('uploads/authors')
    ->acceptedFileTypes(['image/*'])
    ->preserveFilenames()
    ->hiddenLabel()
    ->pathGenerator(DefaultPathGenerator::class)
    ->required(),

With DatePathGenerator (images are not shown):

CuratorPicker::make('image_id')
    ->relationship('image', 'id')
    ->multiple(false)
    ->directory('uploads/authors')
    ->acceptedFileTypes(['image/*'])
    ->preserveFilenames()
    ->hiddenLabel()
    ->pathGenerator(DatePathGenerator::class)
    ->required(),

Additional details:

  • If you first upload an image using DefaultPathGenerator, it is shown in the picker. If you then upload new images with DatePathGenerator, only the image uploaded with DefaultPathGenerator is displayed. The new images uploaded with DatePathGenerator do not appear.
  • All images are correctly saved to the database and exist on the filesystem.

Expected behavior
All images uploaded via CuratorPicker should be visible in the picker, regardless of which PathGenerator was used.

Steps to reproduce

  1. Use CuratorPicker with DefaultPathGenerator and upload an image. The image is shown in the picker.
  2. Switch to DatePathGenerator and upload a new image.
  3. Images uploaded with DatePathGenerator are not shown in the picker, but those uploaded with DefaultPathGenerator are still visible.

Screenshots/Images

  • Picker with DefaultPathGenerator:
    image2
  • Picker with DatePathGenerator:
    image1

Reproduction repository
(Not available)

Relevant log output
(No relevant logs available)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions