After switching over to PHP 7.1, I'm getting the following when trying to submit a block-based subscribe form ...

Warning: Illegal string offset 'addr1' in drupal_array_set_nested_value()
(line 6780 of docroot/includes/common.inc).

Error: Cannot create references to/from string offsets in
(line 6780 of docroot/includes/common.inc).

I found a similar issue here ...
https://www.drupal.org/project/invite/issues/2955023

I'm guessing it might be an issue here (mailchimp.module line ~ 1685) ...

// Special cases for MailChimp hidden defined fields:
if ($mergevar->public === FALSE) {
    $input['#type'] = 'hidden';
  }

I imagine it should be ...

// Special cases for MailChimp hidden defined fields:
if ($mergevar->public === FALSE) {
    $input['#access'] = FALSE;
  }

... but I haven't actually tested that yet.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

matt_paz created an issue. See original summary.

matt_paz’s picture

Issue summary: View changes
matt_paz’s picture

Issue summary: View changes
matt_paz’s picture

I've confirmed that this appears to fix the issue.

wmfinnegan’s picture

Did you happen to run into any other PHP7 issues? On my site registration form, I'm now seeing an error related the count() function, which I'm assuming might be related to the shared host recently upgrading to PHP7.

Here is the error:
Warning: count() [function.count.php (link is external)]: Parameter must be an array or an object that implements Countable in GuzzleHttp\Handler\CurlFactory->release() (line 67 of [...]/sites/all/libraries/mailchimp/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php).

EDIT: Looks like this can be resolved by updating Guzzle or a one-line code fix (https://github.com/guzzle/guzzle/issues/1973). For me, this was resolved by updating the the Mailchimp Library to v1.0.9 which had Guzzle 6.3 (https://github.com/thinkshout/mailchimp-api-php/releases).

matt_paz’s picture

@wmfinnegan, no, I haven't noticed any other issues so far, but we're only using a small part of the functionality the module provides. There may be other areas that need TLC.

g.weston’s picture

Status: Active » Needs review
FileSize
403 bytes
matt_paz’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for going ahead and adding the patch @g.weston

Setting this to rtbc.

Proteo’s picture

Yet another confirmation, patch from #7 fixed the issue for me.

cmseasy’s picture

Patch #7 solved this for us to. Thanks.

samuel.mortenson’s picture

Status: Reviewed & tested by the community » Needs work

Setting #access to FALSE and using #type hidden are not equivalent - hidden inputs are present in the browser and may be used in client side code or may need to be present in the POST request.

samuel.mortenson’s picture

Status: Needs work » Reviewed & tested by the community

Sorry for jumping to conclusions with #11 - I re-read the logic for this think it's eligible for commit.

rjacobsen0’s picture

Version: 7.x-4.x-dev » 7.x-5.x-dev

Checking this patch in.

  • rjacobsen0 committed 0b7f537 on 7.x-5.x authored by g.weston
    Issue #2998627 by g.weston, matt_paz, samuel.mortenson, wmfinnegan,...

  • rjacobsen0 committed 416d9ef on 7.x-4.x authored by g.weston
    Issue #2998627 by g.weston, matt_paz, samuel.mortenson, wmfinnegan,...
rjacobsen0’s picture

Status: Reviewed & tested by the community » Fixed

Done. Thanks everyone!

Status: Fixed » Closed (fixed)

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