Error:

Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /home/xcomkids/public_html/sites/all/modules/contributions/simplenews_analytics/simplenews_analytics.module on line 106

When using previous version of PHP.
You can't use then reference in foreach in PHP 4.x

There can be module installation restriction for 5.x or it can be converted to be compatible.

    foreach ($text as &$element) {
      _simplenews_analytics_parse_body($element);
    }
CommentFileSizeAuthor
#2 simplenews_analytics.359751.patch748 bytessutharsan

Comments

kenorb’s picture

Status: Active » Needs review

I'll test this code:

    foreach ($text as $element) {
      _simplenews_analytics_parse_body($text[$element]);
    }

Error dissappeared, but but I don't know how to test the functionality of this code:)

sutharsan’s picture

StatusFileSize
new748 bytes

Better use this:

    foreach ($text as $key => $element) {
      _simplenews_analytics_parse_body($text[$key]);
    }

Patch attached.

sutharsan’s picture

Status: Needs review » Fixed

Committed.

kenorb’s picture

Thanks.

Status: Fixed » Closed (fixed)

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