Posted by rsvelko on January 14, 2009 at 12:10am
Jump to:
| Project: | Composite Layout |
| Version: | 6.x-1.0-beta5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | bengtan |
| Status: | closed (fixed) |
Issue Summary
hi,
look for this text and notice the typo at the last lines about
primary_key
$schema['node_composite_references'] = array(
'description' => t('References table for Composite Layout module. '),
'fields' => array(
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
'type' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
// id identifies the thing (ie. node, block etc.) to display
'id' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
// data contains additional settings
'data' => array('type' => 'text', 'size' => 'medium', 'not null' => TRUE, 'serialize' => TRUE),
// these fields follow {blocks}
'zone' => array('type' => 'varchar', 'length' => '64', 'not null' => TRUE, 'default' => ''),
// 'visibility' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '4'),
// 'pages' => array('type' => 'text', 'not null' => TRUE, 'default' => ''),
// 'title' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
),
/*
'indexes' => array(
'nid' => array('nid'),
),
*/
'primary key' => array('vid, id'),
);I've just tried the awesome http://drupal.org/project/schema module - and it showed me that:
( taken from admin/build/schema )
Mismatch (2)
Tables for which the schema and database are different.
composite
*
node_composite_references
o primary key:
declared: array('vid, id')
actual: array('vid', 'id')So? Is this a bug - and what could it have affected? (as far as my php knowledge tells me it is wrong... but then - it somehow got the right way into the DB . How? Maybe the drupal schema API that handles it is smart enough? )
Comments
#1
Hi,
Thanks for pointing this out.
I believe you are right that it's a typo bug.
However, I don't think there are any ill effects. I suspect the Drupal schema api translates 'vid, id' and 'vid', 'id' into the same database query underneath, so even though Composite Layout's table declaration is incorrect, it still (fortunately) results in a correct database query.
But, I will investigate this further, and come up with a fix. I need to especially make sure a fix will not break existing sites.
#2
Composite Layout 6.x-1.0beta6 has been released with fixes for this issue. Please use and let me know how things go.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.