Download & Extend

ALTER TABLE error when adding a viewreference

Project:View reference
Version:6.x-2.11
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

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

Status:active» fixed

#3

Status:fixed» closed (fixed)

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