This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I'm having a problem, I had this working before, but now it's just throwing an error and I didn't change anything except updating my October, I'm on build 469.
The error is the following:
"SQLSTATE[HY000]: General error: 1364 Field 'disk_name' doesn't have a default value (SQL: insert into `system_files` (`is_public`, `field`, `attachment_id`, `attachment_type`, `updated_at`, `created_at`) values (1, logo, 2, Author\Plugin\Models\Model, 2020-09-23 15:04:51, 2020-09-23 15:04:51))" on line 664 of /root/website/public/vendor/laravel/framework/src/Illuminate/Database/Connection.php
My component code is as follow
$model = new Model();
$model->logo = Input::File('logo');
$model->save();
In my model I have:
public $attachOne = [
'logo' => ['System\Models\File'],
];
The files aren't uploaded, there is nothing in system_files tablet, or in my disk. When dumping the input, I see that the file is there, so the problem isn't in the form. In my form I have:
<form data-request="mycomponent::onLogoUpload" enctype='multipart/form-data' data-request-files>
<input type="file" name="logo" accept="image/png, image/jpeg">
<button type="submit">Submit</button>
</form>
What am I doing wrong?
Last updated
This has been fixed in 1.1.0 and 1.0.470 (which hasn't been released yet). I recommend you upgrade to 1.1.0 via composer
LukeTowers said:
This has been fixed in 1.1.0 and 1.0.470 (which hasn't been released yet). I recommend you upgrade to 1.1.0 via composer
Sorry, but what do I need to upgrade? My October is on my most recent build, all the plugins I'm using are on their most recent build too.
If you don't want to convert your installation to using composer to manage updates then apply this fix manually until 470 is released: https://github.com/octobercms/library/commit/425b9f54d0ffb858b9bbe319538a14fa488ac58c
LukeTowers said:
If you don't want to convert your installation to using composer to manage updates then apply this fix manually until 470 is released: https://github.com/octobercms/library/commit/425b9f54d0ffb858b9bbe319538a14fa488ac58c
Thanks, that solved the issue.
LukeTowers said:
If you don't want to convert your installation to using composer to manage updates then apply this fix manually until 470 is released: https://github.com/octobercms/library/commit/425b9f54d0ffb858b9bbe319538a14fa488ac58c
Thanks dude. Finally solved after 3 days of searching
1-6 of 6