I was trying to synchronize users and got an error message of user warning: Table 'dpdb.phplist_user_user doesn't exist, which is indeed true. Dpdb is the name of my Drupal database, not the phplist database name I listed in the config settings. Do the phplist tables have to reside in the Drupal database?

CommentFileSizeAuthor
#8 phplist_fix_db_url.patch289 bytesmdixoncm

Comments

sharique’s picture

I'm also having same problem.

sharique’s picture

I get following errors while syncing.

* warning: Missing argument 1 for _phplist_uniqueid() in /www/sites/all/modules/phplist/phplist.module on line 654.
* warning: Missing argument 2 for _phplist_uniqueid() in /www/sites/all/modules/phplist/phplist.module on line 654.
* user warning: Table 'mydb.user_user' doesn't exist query: SELECT id FROM user_user WHERE uniqid='f53a7a67a069669b15ad579a5850d11f' in /www/includes/database.mysqli.inc on line 151.
* warning: Missing argument 1 for _phplist_uniqueid() in /www/sites/all/modules/phplist/phplist.module on line 654.
* warning: Missing argument 2 for _phplist_uniqueid() in /www/sites/all/modules/phplist/phplist.module on line 654.
* user warning: Table 'mydb.user_user' doesn't exist query: SELECT id FROM user_user WHERE uniqid='856f546976b4a5e3bad5bf02b3d76fed' in /www/includes/database.mysqli.inc on line 151.

I'm using mydb for both Drupal and phplist.
I have used prefix phplist_ for tables, but it seems doesn't check that.
--
Sharique

ccdoss’s picture

I'm having a similar problem.

paulbeaney’s picture

Hi,

Your phpList tables should be able to reside on any database server, locally or remotely, and certainly don't have to be in the same one as your Drupal database (although there's no reason why they can't).

I have been unable to reproduce these problems - and I have tried putting my phpList database on localhost and a remote server. The only time I managed to get an error (although not the same as yours) is when I was accessing a MySQL 4.7 database from my Drupal server, which is MySQL 5. That was a MySQL error though - a collation issue.

I have made some changes to the module tonight and uploaded it to CSV so can I ask that you try this update and see if that alleviates the problem. If not, I will delve further and no doubt will need to come back to you for more information.

Regards,

- Paul

becw’s picture

I was having this problem with any phplist db transaction; it happens because phplist.module doesn't switch to the phplist database correctly. It looks like the $db_url array wasn't getting set, even though _phplist_dburl() was getting called... I fixed it by editing my settings.php to use multiple databases; see How to connect to multiple databases within Drupal. The $db_url part of my settings.php file looked like this before:

$db_url = 'mysql://drupal_db_user:drupal_db_pass@drupal_db_host/drupal_db_name';

and now looks like this:

$db_url['default'] = 'mysql://drupal_db_user:drupal_db_pass@drupal_db_host/drupal_db_name';
$db_url['phplist'] = 'mysql://phplist_db_user:phplist_db_pass@phplist_db_host/phplist_db_name';

also, a note: the url components don't seem to be urlencoded when the db url is created within the _phplist_dburl() function, a possible problem for people with odd characters in their db passwords.

paulbeaney’s picture

This is a bit strange as I have 3 Drupal installations and they all work fine without having to edit settings.php. I was aware of being able to do this, although I stuck with the admin page way of defining the database parameters as it seemed a bit more user friendly.

I'd be surprised if URL encoding the database URL made a difference since anything you enter into settings.php is not url-encoded either. Presumably either method could cause problems for people with illegal characters in their passwords?

paulbeaney’s picture

I have just uploaded a new version of the module which fixes bugs with new Drupal users the first time they login. This should solve the last of these problems.

Regards,

- Paul

mdixoncm’s picture

Title: Probs synching » Patch should solve problems
Status: Active » Needs review
StatusFileSize
new289 bytes

While #5 will definitely fix the problem - this patch should solve the bug at source. There was a small problem with the code that is adding the DB defined in the settings page into the $db_url array ...

Cheers,

Mike

paulbeaney’s picture

Mike,

My copy of Eclipse doesn't recognise that file as a valid patch. Could you post your complete _phplist_dburl() function please?

Thanks,

- Paul

steven jones’s picture

Title: Patch should solve problems » Probs synching

Setting title back.

liliplanet’s picture

Yes, that is the source of my problem. The module does not update of where the PHPList installation is installed and keeps it as the local db (where the module is installed).

Would love to know how to fix this please as no matter how many times I re-install it stays with the same error.

Any suggestions would be great, thanx!
Lilian

that0n3guy’s picture

I am also getting the "user warning: Table 'dbname.phplist_user_user' doesn't exist query" errors. I tried the patch in #8 and it did not seem to work. With the patch I no longer get errors, but nothing seems to happen after I hit the sync button, it just goes to a blank page and when I check my database, no users were synced.

Could this be because my modules are installed in sites/default/modules instead of sites/all/modules (isnt that where the handbook says to put them?).

I am using XAMPP on pclinusos with mysql 5.0.51. The drupal database and phplist database are on the same server.

that0n3guy’s picture

Alright, I got my sync to work. Some of these step may not have had anything to do with it now working, Im just telling you what I did:

-deleted my phplist database that was named listsdb and created a new one named phplist
-I added a password to my mysql database user(I am using xampp on my home computer and it defaults to no password so thats why there wasnt one in the first place)
-I modified my settings.php (for drupal) and my config.php (for phplist) so they had a password to access the database
-it syncs and works now.

Hopefully this will help find the root of this problem.
(now I need to figure out how to use this with anonymous users)

paulbeaney’s picture

I have applied mdixoncm's patch to CVs now. Seems to fix the last of the problems where Drupal seems to not be able to switch to the phpList database in My Account - My Newsletters and other places.

Regards,

- Paul

paulbeaney’s picture

Status: Needs review » Closed (fixed)

Done and dusted.

sharique’s picture

Thanks

oldmanpants’s picture

Hi.

Using 5.x-1.0 and still getting the "user warning: Table 'database.phplist_user_user' doesn't exist query".

Phplist db tables are prefixed with phplist_ and phplist_user_

Using Drupal 5.5

Any ideas? Thanks!

paulbeaney’s picture

Hi timkolke,

Sorry, I don't have any ideas for you. As far as I can tell the latest version is pretty much watertight in terms of switching correctly between the databases (phpList and Drupal). Do you get any errors on the "My Newsletters" tab in My Account?

Regards,

- Paul