Hey there! Thanks for working on this module... I'm excited to include it on my new site!

I just installed this module and it seems to set up correctly but I'm having a couple of issues:

1. I'm getting a error on my home page (where the subscribe block is). The error is:

warning: Invalid argument supplied for foreach() in /DOMAINNAME/sites/all/modules/phplist/phplist.module on line 884.

2. Also, in the subscribe block it doesn't show a list I have set up in phplist. Nothing shows up next to "Subscribe me to:"... even when I have "Show subscription checkboxes in user registration form" checked in my phpList configuration.

Thanks very much for your help!

Comments

tflmike’s picture

So in attempt to fix everything, I cleaned out my database and reinstalled the module. After installation I check the db and it seems like every thing's in place, but now I'm getting an even more troublesome error:

user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT userid FROM phplist_listuser t2 WHERE t2.listid=l.id AND query: SELECT DISTINCT l.id as lid, l.name as name, l.description as description, (SELECT userid FROM phplist_listuser t2 WHERE t2.listid=l.id AND userid=0) as 'userid' FROM phplist_list l LEFT OUTER JOIN phplist_listuser t2 ON l.id = t2.listid WHERE active=1 ORDER BY listorder in /DOMAIN/includes/database.mysqli.inc on line 151.

Whoa.... what's this all about?

Thanks again for your help!

tflmike’s picture

Priority: Normal » Critical
Status: Active » Needs work

Hello- Just wondering if I could get some feedback about the above.... as is, this module doesn't work.

paulbeaney’s picture

Hi,

This sounds like a phpList database configuration issue to me. Can you confirm the settings for $table_prefix and $usertable_prefix from your phpList config.php file ? And also the setting you have for "Table prefix :" in the phpList module administration page?

Regards,

- Paul

tflmike’s picture

Hi Paul, thanks for your response!

Here's my settings:

config.php file (phplist):
$table_prefix = "phplist_";
$user_prefix = "phplist_user_";

in phpList administration:
Table prefix: phplist_

I also just discovered something interesting: When I have a user logged in, I don't get the 'WARNING: Error in your SQL syntax...' but as soon as I log out, the warning shows up again.

How do I set this up so that anonymous users can subscribe to the mailing list?

Thanks!

paulbeaney’s picture

Can you copy and paste the entire error message again please ? My config looks to be identical to yours and the query that you posted in post #1 runs fine on my box - I would like to check that there isn't some minute difference in the query now.

Thanks,

- Paul

tflmike’s picture

The warning I'm getting is:

user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT userid FROM phplist_listuser t2 WHERE t2.listid=l.id AND query: SELECT DISTINCT l.id as lid, l.name as name, l.description as description, (SELECT userid FROM phplist_listuser t2 WHERE t2.listid=l.id AND userid=0) as 'userid' FROM phplist_list l LEFT OUTER JOIN phplist_listuser t2 ON l.id = t2.listid WHERE active=1 ORDER BY listorder in /homepages/26/d71817135/htdocs/mydomain/includes/database.mysqli.inc on line 151.

Here's the code the error is talking about in my 'database.mysqli.inc' file:

147 |  if (!mysqli_errno($active_db)) {
148 |   return $result;
149 |  }
150 |  else {
151 |   trigger_error(check_plain(mysqli_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
152 |   return FALSE;
153 |  }

I only get the warning when I don't have a user logged in and when I have the phpList block enabled in my right sidebar. My right sidebar also includes: a user login block, a list view and 2 ads served up by the Openads module.

Thanks again for your thoughts!

paulbeaney’s picture

Hi,

This is a strange problem to be sure. The query that MySQL is complaining about looks fine - there's nothing at all wrong with the syntax or anything. It is strange that MySQL reports an error starting at he first 'SELECT' though - this implies that either there is some other SQL being added prior to this (by another module), or - and I'm not sure about this - the version of MySQL you are using doesn't like the whole thing. Have you tried copying and pasting that SQL into phpMyAdmin or some MySQL query tool to check it works ok?

If it works then I can only conclude that some other module is intefering, and if it doesn't then I would say you are using an old version of MySQL.

Good luck finding the problem !

- Paul

tflmike’s picture

Hmmm... Well I set up phpList and phpList integration module to work off the same mySQL database, which I believe is correct. I don't have any other modules configured to use that db...

One thing that I recently discovered was that when I was working on my custom user login, I tried to add a 'register' link and when I clicked on it, I got the same error. Does that mean the the phplist integration module is looking for the phplist user info in my Drupal website db? Like I mentioned before, they are two different databases so maybe it's just having a problem finding the right one...

Also, my ISP is running php 5.2.6 and mySQL 5.0.32 – if that helps at all.

tflmike’s picture

Title: Warning Error and Block not showing the list. » SOLVED!
Status: Needs work » Closed (fixed)

For anyone who got this same error:

I checked the mySQL database which phpList was connected to and I noticed that it was actually a mySQL 4 database (as opposed to mySQL 5 which I thought earlier). So I made a new database – this time making sure it was mySQL version 5 and the error dissappeared!

So that's it... just make sure your db is mySQL version 5.

Cheers!

tflmike’s picture

Title: SOLVED! » MySQL error when making phpList block active: SOLVED!