The statistics dosen't works with Simplenews 7.x-1.0-beta2.
Simplenews changed his mail objects and functions http://api.worldempire.ch/api/simplenews/includes%21simplenews.source.in...
Please Update your module on lines 149, 150, 151 with the follow

$category = $message['params']['simplenews_source']->getCategory();
$node = $message['params']['simplenews_source']->getNode();
$subscriber = $message['params']['simplenews_source']->getSubscriber();
if ($message['module'] == 'simplenews' && $category->format =='html') {
$nid = $node->nid;
$mail = $subscriber->mail;

Comments

jjchinquist’s picture

Status: Patch (to be ported) » Needs work

Looking at this issue. I believe it is rather a problem in the mail_alter hook.

In simplenews.module::simplenews_confirmation_send() the $params['context'] variable appears to be set (confirming soon).
Simplenews calls drupal_mail.
Printing out the $message array that is sent to the function simplenews_statistics_mail_alter, the $message['params']['context'] is no longer present.

Any help is appreciated.

jjchinquist’s picture

StatusFileSize
new6.09 KB

Unfortunately, to make the module work, some changes must be made to the simplenews base module.
Required is a successful patch at: http://drupal.org/node/1537102

Simplenews has changes structure significantly since the last time this module was written.

Multiple changes were required to be compatible with simplenews base module. This patch is a start, but is not complete.

There seems to be an additional error within the _simplenews_statistics_parse_links function. See the single quote error inside of preg_replace:

else{
    // Replace links
    $pattern = '/(<a[^>]+href=")([^"]*)/emi';
    $body = preg_replace($pattern, '"\\1"._simplenews_statistics_replace_url("\2", $nid, $mail)', $body);
  }
weseze’s picture

The current 7.x dev code is untested and unsuported. The module will be rewritten properly for D7 soon.
Patching the current code is a bad idea since it is based on an outdated architecture.

jjchinquist’s picture

I do understand, and would be interested in helping to get this up and running in the following days. Is there any documentation for the upgrade?

jjchinquist’s picture

Uploading a patch of changes from the current 7.x-1.x-dev.

This patch is actually a result of taking a fresh copy of the 6.x-3.x-dev, running it through coder and updating the syntax to 7.x. It has been manually tested. The test cases must be written and community testing is required.

jjchinquist’s picture

Status: Needs work » Needs review
StatusFileSize
new69.63 KB

test patch

jjchinquist’s picture

Assigned: Unassigned » jjchinquist
StatusFileSize
new69.63 KB

attempting to trigger testing of patch...

jjchinquist’s picture

This version does work on 1 website. The patch should be manually tested.
Only Views integration is remaining.

jjchinquist’s picture

Status: Needs review » Closed (duplicate)

Cross referencing http://drupal.org/node/1390184 and setting as a duplicate.
patches will be added in the other issue.