I installed Drupal tables using "drupal6_" prefix. When installing the addressbook module, the corresponding tables are created without the prefix (i.e.: tables are created as "addressbook_family" instead of "drupal6_addressbook_family").
I renamed the tables in MySQL to correct this installation bug. Unfortunately, this put the module in trouble: queries on addressbook talbes do not work any more. I browsed the addressbook.module file and found that addressbook_* tables did not have aliases. See example below (lines 3282 to 3288 of the addressbook.module file):
$query = 'SELECT first_name, middle_name, last_name, mobile, email, birth_day, work, notes, active_roles, wanted_roles, ';
$query .= '(SELECT street FROM {addressbook_family} WHERE fid=addressbook_member.fid) street, ';
$query .= '(SELECT zipcode FROM {addressbook_family} WHERE fid=addressbook_member.fid) zipcode, ';
$query .= '(SELECT city FROM {addressbook_family} WHERE fid=addressbook_member.fid) city, ';
$query .= '(SELECT country FROM {addressbook_family} WHERE fid=addressbook_member.fid) country, ';
$query .= '(SELECT telephone FROM {addressbook_family} WHERE fid=addressbook_member.fid) telephone ';
$query .= 'FROM {addressbook_member} ORDER BY last_name DESC, middle_name, first_name';
Hence, {addressbook_member} is correctly replaced by 'drupal6_addressbook_members' at execution time, but "fid=addressbook_members.fid" remain unchanged. SQL fails returning an error message telling that "addressbook_members" was not found.
I corrected the last line by defining an alias for addressbook_member like below:
$query .= 'FROM {addressbook_member} as addressbook_member ORDER BY last_name DESC, middle_name, first_name';
I did not try to correct the installation process as I am rather new to Drupal, but I suggest you apply the correction above in the addressbook.module file as it is easy to rename tables by hand.
regards,
Comments
Comment #1
jacofee commented