Users not subscribed to any list

cbrody - August 22, 2008 - 11:09
Project:phplist Integration Module
Version:5.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I am using the phplist block, which correctly lists the two active lists on my site. However, anonymous users are not being subscribed to any list, no matter which lists are ticked in the subscribe block. Users are being added to the PHPlist database, and a confirmation email is sent, but they are not being added to the list(s) they ticked. The subscribe pages provided by PHPlist work correctly. Any ideas as to what might be wrong with my setup?

#1

paulbeaney - September 1, 2008 - 09:05

Hi cbrody,

Seems strange that everything except the list subscription is working.. Is your site publicly accessible so I can take a peek at it?

Regards,

- Paul

#2

paulbeaney - September 9, 2008 - 15:16

I have come across an interesting problem on my own server which may shed some light on this problem - the only thing is that I have no idea to fix or work round it. Bascially, the problem seems to be that if a phpList server is specified which is anything other than an IP address, it seems the call to drupal_httpd_request in the phpList module can't do a DNS lookup and fails with an error code -19074860.

If anyone else could confirm this, it would be very helpful, and if there is anyone watching this issue who knows about sockets and the underlying processes, any insight would be very useful. For info, my configuration is OSX Leopard, PHP 5.2.5, Apache 2.2.8.

Regards,

- Paul

#3

paulbeaney - September 9, 2008 - 15:48

Ok, I have just updated the DEV versions of both modules to fix the issue where users were getting added to the phpList database, but not signed up to the lists - you should find this works ok now. It *doesn't* resolve the DNS lookup problem, but I guess that might just be specific to my machine.

Please test and let me know.

- Paul

#4

paulbeaney - September 9, 2008 - 15:52
Status:active» needs review

Spoke too soon - Drupal won't let me update CVS from Eclipse at the moment.

Here's a patch file instead.

Regards,

- Paul

AttachmentSize
patch.txt 852 bytes

#5

paulbeaney - September 15, 2008 - 08:14
Status:needs review» closed

Patch is now in the HEAD releases.

#6

cbrody - September 17, 2008 - 11:33

I've tried the new version and get the error "Oops, you have not been added to the mailing list; please contact a site administrator." The emails are being added to the database but not added to the mailing list(s).

#7

paulbeaney - June 1, 2009 - 06:56

Hi,

I have just re-downloaded the D5-dev version to double-check everything is ok, and it works fine for me. You could try adding these lines to the module (inserting them at line 1012 - new code is in bold. D6-DEV users, please see line 1290):
$result = drupal_http_request($subscribe_url, $headers, 'POST', $postdata);

print_r($result);
exit;

if ($result->code != 200 || strpos($result->data, 'Thank you for subscribing') === FALSE) {

Running that will show you what (if anything) Drupal is receiving back when it sends the information to your phpList server.

Regards,

- Paul

#8

cbrody - September 18, 2008 - 10:04

My previous post was incorrect -- users are now being added to the list(s). Thanks for fixing this. However, the "Oops..." error message still appears, perhaps because we are not using the default subscribe page? Here's the data returned:

stdClass Object
(
    [request] => POST /lists/?p=subscribe HTTP/1.0
Host: iiedtest.merfa.co.uk
User-Agent: Drupal (+http://drupal.org/)
Content-Length: 126
Content-Type: application/x-www-form-urlencoded

email=chris%40cbrody.com&emailconfirm=chris%40cbrody.com&htmlemail=1&subscribe=Subscribe&list%5B2%5D=signup&list%5B3%5D=signup

    [data] => <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

followed by the customised page (which includes the string "Thank you for subscribing"), then:

</html>

    [headers] => Array
        (
            [Date] => Thu, 18 Sep 2008 09:49:20 GMT
            [Server] => Apache/2.2.3 (CentOS)
            [X-Powered-By] => PHP/5.1.6
            [Set-Cookie] => PHPSESSID=67t8nfmcgs5gom2ljl03goa5v5; path=/
            [Expires] => Thu, 19 Nov 1981 08:52:00 GMT
            [Cache-Control] => no-store, no-cache, must-revalidate, post-check=0, pre-check=0
            [Pragma] => no-cache
            [Connection] => close
            [Content-Type] => text/html
        )

    [code] => 301
    [redirect_code] => 200
    [redirect_url] => http://iiedtest.merfa.co.uk/lists/?p=subscribe
)

#9

paulbeaney - September 18, 2008 - 10:21
Status:closed» active

Hi,

Looking at line 1013 in the module, and your HTTP header information (thanks for that - very useful), I would guess that the redirection is causing the problem. The module looks for a return code of 200, but your setup gives a 301 redirection. Try changing :

  if ($result->code != 200 || strpos($result->data, 'Thank you for subscribing') === FALSE) {

to:

  if (!($result->code == 200 || $result->code == 301) || strpos($result->data, 'Thank you for subscribing') === FALSE) {

to see if that helps?

Regards,

- Paul

#10

cbrody - September 18, 2008 - 10:40

It now works correctly; thanks.

Two further things (perhaps I should start new issues):

1. Rather than display a drupal message, it would be useful to have an option to re-direct to the subscribe page instead (the message block gets rather lost on our home page).

2. The subscribe block doesn't appear if you're logged in. Is this by design?

#11

paulbeaney - September 18, 2008 - 11:38

Hi,

In regards to your issues:

1. A subscribe page doesn't exist for anonymous users. That side of things is handled exclusively by phpList for this class of user, hence why the only sensible thing is to come back to the same page.

2. Yes, this is by design. You'd really need a different block for logged in users, as they don't need to enter their email or submit their subscription via this mechanism - it is all handled in "My Account" (and goes direct into the phpList databse, thus bypassing confirmation emails etc.) It would be feasible to create block for logged-in users which simpl showed X lists with toggle buttons to (un)subscribe from each list.

Regards,

- Paul

#12

paulbeaney - November 26, 2009 - 11:22
Status:active» closed

No recent activity

 
 

Drupal is a registered trademark of Dries Buytaert.