Project:Web File Manager
Version:6.x-2.11
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I try to install WFM to clean drupal 6.9 & get this error

user warning: BLOB/TEXT column 'fdesc' can't have a default value query: CREATE TABLE webfm_file ( `fid` INT unsigned NOT NULL auto_increment, `uid` INT unsigned NOT NULL DEFAULT 0, `fpath` MEDIUMTEXT NOT NULL, `fsize` INT unsigned NOT NULL DEFAULT 0, `fmime` VARCHAR(255) NOT NULL DEFAULT '', `ftitle` VARCHAR(255) NOT NULL DEFAULT '', `fdesc` TEXT NOT NULL DEFAULT '', `fcreatedate` INT NOT NULL DEFAULT 0, `flang` VARCHAR(255) NOT NULL DEFAULT '', `fpublisher` VARCHAR(255) NOT NULL DEFAULT '', `fformat` VARCHAR(255) NOT NULL DEFAULT '', `fversion` INT NOT NULL DEFAULT 0, `perm` TINYINT NOT NULL DEFAULT 0, `dl_cnt` INT NOT NULL DEFAULT 0, PRIMARY KEY (fid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in C:\www-root\d69\includes\database.inc on line 515.

I have MySql 5.0.51a and never get such kind of errors before.

Comments

#1

Try replacing the following line...
'fdesc' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE, 'default' => ''),
...with
'fdesc' => array('type' => 'text', 'not null' => TRUE),
...inside webfm.install

#2

Same.
Change suggested by robmilne will lead in later issue when i try to update metadata without entering a file desc ('column fdesc have no default').
Solved changing...
'fdesc' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE, 'default' => ''),
with
'fdesc' => array('type' => 'text', 'size' => 'normal', 'not null' => FALSE),
Hope helps.

#3

Status:active» needs review

Added:

  if(!isset($metadata['fdesc']))
    $metadata['fdesc'] = '';

just below line 2412 in webfm.module.

Tried in my installation (intranet app) seems OK

#4

Yes. I have had this in my code for some time now but did not commit.

#5

Status:needs review» fixed

See rc5

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#7

Version:6.x-2.10-rc4» 6.x-2.11
Status:closed (fixed)» active

I'm running Drupal 6.13 and WebFM 2.11 and the problem still exists.

#8

line 71 'fdesc' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE, ),

I changed the install file, and remove the default value from array.
Hope it works for you!

#9

This issue is definitely still present in the latest point release 2.11

#10

Hi All.

I was having the same problem.

I have "phpmyadmin" installed so I went there to try executing the line that the module was having problem.

I could make it working by using executing this SQL instructions:

CREATE TABLE webfm_file ( `fid` INT unsigned NOT NULL auto_increment, `uid` INT unsigned NOT NULL DEFAULT 0, `fpath` MEDIUMTEXT NOT NULL, `fsize` INT unsigned NOT NULL DEFAULT 0, `fmime` VARCHAR(255) NOT NULL DEFAULT '', `ftitle` VARCHAR(255) NOT NULL DEFAULT '', `fdesc` TEXT NOT NULL, `fcreatedate` INT NOT NULL DEFAULT 0, `flang` VARCHAR(255) NOT NULL DEFAULT '', `fpublisher` VARCHAR(255) NOT NULL DEFAULT '', `fformat` VARCHAR(255) NOT NULL DEFAULT '', `fversion` INT NOT NULL DEFAULT 0, `perm` TINYINT NOT NULL DEFAULT 0, `dl_cnt` INT NOT NULL DEFAULT 0, PRIMARY KEY (fid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */

Open Drupal database and execute this SQL.

Hope this helps.

#11

Belated followup. I used robbin.joe's suggestion (#8) and it worked.

#12

Priority:critical» normal
Status:active» fixed

This has been fixed some time ago, I believe.

#13

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.