Closed (won't fix)
Project:
Web File Manager
Version:
5.x-2.15
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2008 at 03:27 UTC
Updated:
29 Jun 2010 at 21:48 UTC
I try to upload a 14k html file, but get the following message:
# ser warning: Field 'fdesc' doesn't have a default value query: INSERT INTO webfm_file (fpath, uid, fsize, fcreatedate, perm, fmime) VALUES ('sites/default/files/documents/318365.htm', 1, 14561, 1225681896, 2, 'text/html') in C:\Apache2.2\htdocs\sites\all\modules\webfm\webfm.module on line 2538.
# Could not insert sites/default/files/documents/318365.htm into the database
# Insertion into database fail
I have tried it with another small msword file with same results.
I am running drupal on Apache/window xp machine.
Comments
Comment #1
lilon commentedI have found a similar problem from 2007 and the solution was to add the following to the dbinsert_file function in webfm.module:
$metadata['fdesc'] = '';
I tried it and it solved the problem.
According to the old post it was supposed to be added to the next version at the time. I wonder why it was taken out again?
Would appreciate comments
Comment #2
dmsmidtI had the same issue. Also fixed it by inserting $metadata['fdesc'] = '';.
Seems critical to me.
Drupal 6.6
Comment #3
robmilne commentedThe proper fix is in head and documented here:
http://drupal.org/node/327993
Comment #4
Rocketman commentedI am experiencing the same issue with Drupal 5.x and WebFM 5.x-2.15 on Windows with IIS6.
What is the fix for 5.x-2.15?
Comment #5
robmilne commentedSimilar fix:
Replace line 18 of webfm.install with...
fdesc text NOT NULL default '',...uninstall and reinstall
Unfortunately this will destroy the webfm_files and webfm_attach tables and all metadata and attachments will have to be recreated - not cool unless the site is virginal. The way to minimize damage would be to add this to webfm.install and run update.php:
This will destroy current descriptions but leave other data intact
Comment #6
Rocketman commentedI tried running update.php after making the changes to webfm.install but get this error:
webfm module
Update #3
* ALTER TABLE {webfm_file} DROP fdesc
* Failed: ALTER TABLE {webfm_file} ADD fdesc text NOT NULL DEFAULT ''
Even with this error the problem is now fixed and uploads are working.
Thanks for the help.
Comment #7
robmilne commentedDoes the fdesc column still exist in your webfm_file table? I imagine it does if the module is working but the failed message is worrisome. A quick check with phpMyAdmin will confirm its existence.
Comment #8
meichr commentedThe problem with the solution of adding a default value to a text field ist that some versions of MySQL 5 seem not to allow default values on text fields, see my comment in this issue.
Under version webfm-6.x-2.11 there is an implementation of the solution to set the field 'fdesc' to an empty string value '' if it would be NULL before the INSERT into the database. I suggest to backport this solution to 5.x-2.15 with the suggested patch of my comment here.
Comment #9
meichr commentedAs this issue is solved for webfm-6.x-2.11 I move it to the version wenfm-5.x-2.15 to address the existing necessity of the patch there. Hope this is ok.
Comment #10
nhck commentedAs per #803722: Cease support of Drupal 5? support for D4 and D5 has been closed. Sorry, please upgrade to Drupal 6. If you think this issue still applies with Version 6.x please reopen this issue with correct version tag.
Thank you! :-)
Comment #11
nhck commented