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

robmilne’s picture

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

mas160’s picture

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.

mas160’s picture

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

robmilne’s picture

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

robmilne’s picture

Status: Needs review » Fixed

See rc5

Status: Fixed » Closed (fixed)

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

jasoncd’s picture

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.

robbin.zhao’s picture

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!

mdeltito’s picture

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

arthur.duarte’s picture

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.

jasoncd’s picture

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

nhck’s picture

Priority: Critical » Normal
Status: Active » Fixed

This has been fixed some time ago, I believe.

Status: Fixed » Closed (fixed)

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