When I try to install WebFM rc3 for drupal 6, I receive the following 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:\**local-file-path**\includes\database.inc on line 515.

Comments

OgreSwamp’s picture

Same error for me.
Windows XP sp 3.
Apache 2.2
MySQL 5.1
Drupal 6.9

robmilne’s picture

Inside webfm_schema() of webfm.install replace
'fdesc' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE, 'default' => ''),
with
'fdesc' => array('type' => 'text', 'not null' => TRUE),

The downside to fixing this via an update is that the field has to be dropped/recreated which means all description data is lost.

I'd love to replace the metadata component with a proper solution but I lack the time to architect it. Rdf feels right but I just don't have the cycles.

meichr’s picture

As of version webfm-6.x-2.11 the metadata component mentioned by robmilne contains the fix of setting field 'fdesc' to the string '' if it was NULL before INSERTing into the database. But because the default value is still in the install routine the error still might occur with some versions of MySQL on some platforms.

I suggest to remove the default value from the next release webfm-6.x-2.12 as it is not necessary anymore and causes problems for some MySQL versions.

meichr’s picture

Version: 6.x-2.10-rc3 » 6.x-2.11
Priority: Critical » Normal

Setting version to current version and priority to normal as it is caused only by some MySQL versions on some platforms, hope this is how it is properly done.

jorgbert’s picture

This solution took care of my problem. Thanks so much, Rob!

The 'size' => 'normal' seems to be what is causing the problem.

Windows XP SP3 or Windows Server 2003
MySQL database 5.1.44
PHP 5.2.13
PHP memory limit 128M
Web server Apache/2.2.14 (Win32) PHP/5.2.13

Gilbert Jorgensen

robmilne’s picture

Status: Active » Fixed

Fixed as per comment #2. Committed to head

Status: Fixed » Closed (fixed)

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