We have installed phpList version 2.10.12 und Drupal 7.2 with the latest phplist-Modul (dev from 2011-Jun-15 ). phplist and Drupal are running on the same domain with two different databases. The connection to the phpList database works und as a logged in User I see the two newsletter lists from phplist when clicking on the "My newsletters"-Link in "My Account". One newsletter has the status "subscribed" (I entered the mailadress manually in phplist), the other is unsubcribed.
About the list with the newsletters drupal shows an error message:
Notice: Undefined index: phplist_html in phplist_user_newsletters() (Zeile 857 von .../sites/all/modules/phplist/phplist.module).

Now, when I click on the "Subscribe"-Link I only get a WSoD and the newsletter is not subscribed. The same happens when I use the "Sync all users to PHPlist" from the Menu (WSoD no users synced). When I enter a new drupal user, this user account is created and his mailadress is entered in phplist, but the newsletter which I checked is not subscribed and the procedure also ends up with a WSoD.

Comments

paulbeaney’s picture

HI,

WSOD is generally lack of memory available to PHP (to the best of my knowledge). Please can you check that first, and if it still causes problems, can you either tweak your server to show the errors, or have a look in your PHP log to see what the error is. I'm afraid that without more precise information it will be well nigh impossible to help you further.

Regards,

- Paul

Chris.Carrigan’s picture

I had a similar issue on a similar install (phplist 2.10.14). I don't get a white screen of death since I upped the memory permitted to php to 128 mb (from 64).

However there is defiantly an underlying problem as when they access the My Newsletters tab users are getting:

Notice: Undefined index: phplist_html in phplist_user_newsletters() (line 857 of.../modules/phplist/phplist.module).

The site is http://www.reformgroups.net/#

Update - this issue also occurs on user account creation

Chris.Carrigan’s picture

Title: White Scree of Death when syncing Drupal Users or Subscribing Newsletter » Undefined index: phplist_html in phplist_user_newsletters()

Ive updated the title of this thread to reflect the underlying problem.

The error message occurs on most phplist operations including account creation.

Notice: Undefined index: phplist_html in phplist_user_newsletters() (line 857 of.../modules/phplist/phplist.module).

The site is http://www.reformgroups.net/#

paulbeaney’s picture

Status: Active » Needs review

Hi,

I couldn't actually reproduce the problem, but I have modified the offending line of code so that hopefully you would never get this error. Please can you test the change that I have just uploaded the D7-DEV release, in particular that it saves your mail format selection properly (and that it shows up in PHPlist ok too)?

Regards,

- Paul

Chris.Carrigan’s picture

Thanks Paul - that has fixed it.

Chris.Carrigan’s picture

Issue tags: -white screen

Oops no it just moved it

New registration gets the following

    Notice: Undefined index: phplist_html in _phplist_sync_user() (line 1235 of .../phplist/phplist.module).
    Notice: Undefined index: label in entity_token_token_info_alter() (line 54 of .../entity/entity_token.tokens.inc).
    Notice: Undefined index: label in entity_token_token_info_alter() (line 59 of .../entity/entity_token.tokens.inc).
    Notice: Undefined index: label in entity_token_token_info_alter() (line 54 of .../entity/entity_token.tokens.inc).
    Notice: Undefined index: label in entity_token_token_info_alter() (line 59 of.../entity/entity_token.tokens.inc).
    Notice: Undefined index: label in entity_token_token_info_alter() (line 54 of .../entity/entity_token.tokens.inc).
    Notice: Undefined index: label in entity_token_token_info_alter() (line 59 of.../entity/entity_token.tokens.inc). 

So I think there is an underlying problem with the phplist_html index. Ping me on skype chris.carrigan_esteliant and we can try to figure out what is going on. I'm European time zone.

paulbeaney’s picture

Hi Chris,

I have made a change at the offending line which should get rid of that error. While I was there I also re-instated the 'Sync users' link in admin settings, as this had disappeared.

Regards,

- Paul

paulbeaney’s picture

Status: Needs review » Fixed

No further news so assuming fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

liliplanet’s picture

Status: Closed (fixed) » Needs work
liliplanet’s picture

I'm sorry really would like to error not to show up, so had a look at the commit of 28 June as mentioned in this thread at

http://drupalcode.org/project/phplist.git/blobdiff/f52fbfc9ee0c33d713e26...

@@ -854,7 +854,7 @@ function phplist_user_newsletters($form, &$form_state) {
       '#type' => 'checkbox',
       '#title' => t('Receive emails in plain text format'),
       '#options' => array(0, 1),
-      '#default_value' => $cur_user->data['phplist_html'],
+      '#default_value' => isset($cur_user->data['phplist_html']) ? $cur_user->data['phplist_html'] : variable_get('phplist_format_default', 0),
       '#weight' => 10,
     );
 

and yes, it's all good in the current .dev. If I could just get rid of the error, can implement the module to my users please :)

liliplanet’s picture

Naturrien’s picture

Priority: Normal » Critical

I am getting these two messages in the configuration panel. They seemed to occur only after I attempted to subscribe an account to a list (and got a white screen when I did so):

Notice: Undefined index: phplist_html in _phplist_sync_user() (line 1225 of /var/www/html/cwg/sites/all/modules/phplist/phplist.module).

Warning: Invalid argument supplied for foreach() in DrupalDefaultEntityController->buildQuery() (line 290 of /var/www/html/cwg/includes/entity.inc).

ajeancharles’s picture

Defensive Coding!

We need to practice this style of coding. Given the number of modules and hooks, it is a miracle we don't have more problems more often. I am willing to help making this code tighter, but someone would have to help me check it in. I still don't get the process, I might be dense here.

Anyway here is 2 examples of how associative values should be treated:
See function phplistbackend_node_load($nodes)

  $node->phplistbackend_status = isset($message['status'])? $message['status'] : "";

  $node->phplistbackend_sendstart = isset($message['sendstart']) ? $message['sendstart'] : "";

instead of

  $node->phplistbackend_status = $message['status'] ;

  $node->phplistbackend_sendstart = $message['sendstart'] ;

I started doing that the warnings started to dissolve away.

paulbeaney’s picture

Status: Needs work » Needs review

D7-DEV just updated with changes contributed by ajeancharles. Should be available for download in a few hours.