I have a multisites install of Drupal 5.11 (actually 2 sites : mysite.com and mysite.tv)
The 2 sites share the same DB except some tables: menus, cache, blocks, variable... (a classic multisites install).
The 2 sites share the same nodes and users.

I use CCK to create new content types.

The issue :
On mysite.com CCK handles content types in content_type_... tables
But on mysite.tv CCK tries to insert nodes in node_...tables

which creates error messages and data loss for nodes that are created on one site and updated on the other.

Comments

yched’s picture

Are you sure you ran update.php on both sites ?

geraud’s picture

Why should I need to run the update.php script ?

This is not an upgrade.
It is a brand new install of drupal 5.11 with cck.

yched’s picture

Problem is that, since your sites share the {system} table, you installed the modules only in one of the sites, but the variable_set() made in content_install() doesn't take for the other site, since they have different {variables} table. Same problem will happen for updates. I'm not too sure how we should deal with this issue.

The immediate fix for you would be to enable devel.module, activate the 'PHP' block, and run this code :

variable_set('content_schema_version', 1003);
moshe weitzman’s picture

Or use the variable editor link in devel.module block to edit that variable to a value of 1003.

geraud’s picture

Thanks a lot Yched.

I digged a bit in the content module code myself and arrived at the exact same conclusion as you.
It is because of the function :

function _content_tablename($name, $entity, $version = NULL)

and the switch statement:

switch ("$version-$entity") {
case '0-'. CONTENT_DB_STORAGE_PER_CONTENT_TYPE :
return "node_$name";
case '0-'. CONTENT_DB_STORAGE_PER_FIELD :
return "node_data_$name";
case '1003-'. CONTENT_DB_STORAGE_PER_CONTENT_TYPE :
return "content_type_$name";
case '1003-'. CONTENT_DB_STORAGE_PER_FIELD :
return "content_$name";
}

karens’s picture

Status: Active » Closed (won't fix)

The D5 version is no longer being supported. Sorry.