I realise that the client feature of hosting module is still buggy and this might solve things a bit
The db schema:
$schema['hosting_client_user'] = array(
'fields' => array(
'user' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'client' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'contact_type' => array(
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
),
'primary key' => array('user'),
);
should be
$schema['hosting_client_user'] = array(
'fields' => array(
'client' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'user' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'contact_type' => array(
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
),
'primary key' => array('client'),
);
this change got rid of the dreaded "Duplicate entry '1' for key 1" when adding a new client
HTH
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 501004_client_key_hotfix.patch | 563 bytes | anarcat |
Comments
Comment #1
anarcat commentedI confirm the bug. This is an oversight in the #371769: allow for n to n and typed user/client relationships feature. The fix is trivial, I'll roll out a patch here for people to hotfix.
This affects only new installs, people upgrading from 0.1 will not suffer from the problem as the update_N function is correct.
Comment #2
anarcat commentedI committed the fix on HEAD. Note that the problem only affects the Drupal 6 version, the Drupal 5 release is fine.
Comment #3
hutch commentedI hope this doesn't cause problems with the insert statements in hosting_client.module, eg
This has user and client reversed in the table
Comment #4
anarcat commentedI don't think that query will cause problems.