Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OriginalFilename missing from table create script after fresh new install #476

Open
mercury64 opened this issue Apr 26, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@mercury64
Copy link

Filament Version

v3.2.71

Plugin Version

v3.5.6

PHP Version

PHP v8.3.4

Problem description

originalFilename missing from database schema during install.

SQL error on first media upload after fresh install.

Expected behavior

All database columns should be created during install.

This needs to be added $table->string('originalFilename');

Steps to reproduce

Install new and add one image.

Reproduction repository

No response

Relevant log output

[2024-04-26 19:18:17] local.ERROR: SQLSTATE[HY000]: General error: 1 table media has no column named originalFilename (Connection: sqlite, SQL: insert into "media" ("alt", "title", "caption", "description", "originalFilename", "disk", "directory", "visibility", "name", "path", "exif", "width", "height", "size", "type", "ext", "updated_at", "created_at") values ....
@mercury64 mercury64 added the bug Something isn't working label Apr 26, 2024
@mercury64 mercury64 changed the title Origina OriginalFilename missing from table create script after fresh new install Apr 26, 2024
@awcodes
Copy link
Owner

awcodes commented Apr 26, 2024

Are you overriding the observer? Curator doesn't actually try to store originalFilename and it's only used when replacing a file where the observer removes it from the form data before saving the record.

@mercury64
Copy link
Author

No I am not overriding anything, zero custom code, fresh install of Laravel, Filament and Curator.

I've done some debugging. When uploading an image, the following happens:
Awcodes\Curator\Components\Forms\Uploader.php, function saveUploadedFiles(), at the following line:
$this->storeFileName($storedFile['path'], $file->getClientOriginalName());

Then in storeFileName function from Filament\Forms\Components\BaseFileUpload $statePath = $this->fileNamesStatePath; where fileNamesStatePath is orignalFilename.

I can only deep dive into the code so far before I start getting lost.

It maybe some conflict with an update with Filament.

I've reinstalled three times, same issue.

@mercury64
Copy link
Author

This occurs from the Media-> New Media -> Create.

This does not happen from the CurratorPicker as a block on my page, Add Media -> Add Files.

@awcodes
Copy link
Owner

awcodes commented Apr 29, 2024

Ok. I will look into it as soon as I can. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants