Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | mailchimp_poss_php_7.1_issue-2998627-7.patch | 403 bytes | g.weston |
Comments
Comment #2
matt_paz CreditAttribution: matt_paz commentedComment #3
matt_paz CreditAttribution: matt_paz commentedComment #4
matt_paz CreditAttribution: matt_paz commentedI've confirmed that this appears to fix the issue.
Comment #5
wmfinnegan CreditAttribution: wmfinnegan commentedDid 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).
Comment #6
matt_paz CreditAttribution: matt_paz commented@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.
Comment #7
g.weston CreditAttribution: g.weston as a volunteer commentedComment #8
matt_paz CreditAttribution: matt_paz commentedThanks for going ahead and adding the patch @g.weston
Setting this to rtbc.
Comment #9
Proteo CreditAttribution: Proteo as a volunteer commentedYet another confirmation, patch from #7 fixed the issue for me.
Comment #10
cmseasy CreditAttribution: cmseasy commentedPatch #7 solved this for us to. Thanks.
Comment #11
samuel.mortensonSetting #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.
Comment #12
samuel.mortensonSorry for jumping to conclusions with #11 - I re-read the logic for this think it's eligible for commit.
Comment #13
rjacobsen0 CreditAttribution: rjacobsen0 at ThinkShout commentedChecking this patch in.
Comment #16
rjacobsen0 CreditAttribution: rjacobsen0 at ThinkShout commentedDone. Thanks everyone!