ALTER TABLE error when adding a viewreference

maxferrario - January 24, 2009 - 15:17
Project:View Reference
Version:6.x-2.11
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Hi, I 'm having problems with last (6.x-2.11 in this moment) version of the module.
When I add a viewreference field to a custom content type I get this error:
====
user warning: BLOB/TEXT column 'field_pezzipubblicatimedium_arguments' can't have a default value query: ALTER TABLE content_type_medium ADD `field_pezzipubblicatimedium_arguments` LONGTEXT DEFAULT '' in \path\do\drupal\installation\includes\database.mysql-common.inc on line 298.
===
I can go on with the settings of the new field, but the arguments i want to pass to the query are not saved.

After checking the DB, I noticed that the column was not created. I then executed by hand the following query:
ALTER TABLE content_type_medium ADD `field_pezzipubblicatimedium_arguments` LONGTEXT

Now the arguments are correctly passed to the view and I get the desired result.

My configuration is:
* Windows XP
* Apache 2.0.59
* PHP 5.2.5
* Mysql 5.0.67
* Drupal 6.9

My guess is that something has to be changed in the code to have a compatibility with MySQL 5.0, but I do not know if the faulty module is really viewreference or CCK instead.

#1

danielb - January 31, 2009 - 10:10

Hmm I'm not sure but I think it's this around line 139

        'arguments' => array('type' => 'text', 'size' => 'big', 'default' => ''),

maybe it should be

        'arguments' => array('type' => 'text', 'size' => 'big'),

Are you able to test if making this change fixes the problem? I don't know much about database configuration but this seems like it is related to a mysql config that I don't have.
So test it you'd have to change the code and create a brand new view ref field.

#2

danielb - February 28, 2009 - 13:05
Status:active» fixed

#3

System Message - March 14, 2009 - 13:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.