1

I have been having issues with the assets plugin in our new server and am having a hard time trying to debug.

When using ee file manager I get the below error. ee: 2.6.1, assets: 2.1.3

A Database Error Occurred
Error Number: 1364

Field 'date' doesn't have a default value

INSERT INTO `exp_assets_files` (`file_name`, `source_type`, `source_id`, `filedir_id`, `folder_id`, `kind`) VALUES ('5551725767_38cb459f19_b.jpg', 'ee', NULL, '2', '1', 'image')

Filename: C:\www-customers\websitename\wwwrootV2\system\codeigniter\system\database\DB_driver.php

When uploading via assets the progress bar fades away and I receive and 200 response of

{"error":"There was an error uploading your file: Assets could not complete the requested operation."}

Paths and permissions are all (supposed to be) set up correctly. Any ideas?

Cheers

  • Hey, is it possible to get CP and FTP access to this site? If so, send them over to support@pixelandtonic.com referencing this thread. Even if it's not possible, contact us there so we can start to debug this. – Andris Sevcenko Jun 12 '13 at 9:58
  • Hi Andris, I didn't see your reply. After a bit of debugging, I found that the date field in the exp_assets_files table was set to not allow NULL and also did not have a default value. Checking the box to allow NULL and setting a defauly value of 0 fixed the problem and now images can be uploaded. My question is, why does this happend and how come the date is not correctly being added to the database? – bkannenberg Jun 13 '13 at 4:42
  • Ben, I haven't seen MySQL complain about this before so I'll asume some strict settings on the server. This is an oversight on our part, however, and we'll fix it with the next Assets release. As for the other part of the question about the date not being correctly added - we add the file first, then we process the meta-data, such as size, height/width (for images) etc and then add that to the already-created row in the table. Are you still having some issues? – Andris Sevcenko Jun 13 '13 at 6:01
  • I can confirm everything is now working :D – bkannenberg Jun 13 '13 at 6:40
  • Well there you go then :) I suggest posting your fix as an answer and accepting for some sweet, sweet karma! – Andris Sevcenko Jun 13 '13 at 6:43
1

After a bit of debugging, I found that the date field in the exp_assets_files table was set to not allow NULL and also did not have a default value. Checking the box to allow NULL and setting a defauly value of 0 fixed the problem and now images can be uploaded.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.