Error retrieving mail - PHP 5.3?

presleyd - September 30, 2009 - 21:44
Project:Mailhandler
Version:6.x-1.8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I'm using a fresh install of Drupal 6.14 and following the instructions given at http://drupal.org/node/542118 to do some testing for forum to listserv integration.

I can setup the mailbox and test it successfully but when I send mail to it and click the 'Retrieve' link on the /admin/content/mailhandler page I always get "warning: Parameter 1 to mailhandler_retrieve_message() expected to be a reference, value given in /var/www/html/includes/batch.inc on line 189."

/var/www/html is where my base Drupal install is located. This machine is running CentOS 5.3 with PHP 5.3 and I'm wondering if the PHP version has anything to do with it. I will test tomorrow on PHP 5.2 but any insights are appreciated.

#1

mfb - October 1, 2009 - 07:04
Category:support request» bug report

This is due to stricter error reporting in PHP 5.3. This was also technically incorrect in PHP 5.2 but there was no warning message. See #360605: PHP 5.3 Compatibility for discussion of workarounds in core. (EDITED to link to a more relevant issue).

#2

mfb - October 1, 2009 - 08:27
Status:active» needs review

It looks to me like the batch API doesn't even use the first parameter at all. So we should be able to create a separate wrapper function for use by the batch API. This needs testing..

AttachmentSize
mailhandler-php53.patch 1.14 KB

#3

presleyd - October 1, 2009 - 16:09

The error indeed goes away with this patch. So far it seems to be working now.

#4

Ian Ward - October 14, 2009 - 18:26

@mfb if you change:

<?php
      $operations
[] = array(
       
'mailhandler_retrieve_message',
        array(
$result, $mailbox, $message_number),
      );
?>

to:

<?php
      $operations
[] = array(
       
'mailhandler_retrieve_message',
        array(
NULL, $mailbox, $message_number),
      );
?>

does the warning go away?

#5

mfb - October 14, 2009 - 19:56

No that doesn't help, because Batch API still passes a value rather than the expected reference to mailhandler_retrieve_message()

 
 

Drupal is a registered trademark of Dries Buytaert.