Fatal error: Cannot use string offset as an array
Gravatar
Joined: 2012-05-09
Posts: 3
Fatal error: Cannot use string offset as an array in /home/***/public_html/app/code/community/Ebizmarts/MageMonkey/Helper/Data.php on line 213

I receive this error when attempting to use the subscribe function on the right sidebar of the home page. http://www.coolerpros.com

Please assist me in solving this issue.

Thanks!
Gravatar
Joined: 2012-03-09
Posts: 1171
Hi Joshua,

In order to repair this quickly you can change the function which is causing the error on /home/coolerpr/public_html/app/code/community/Ebizmarts/MageMonkey/Helper/Data.php

public function subscribedToList($email, $listId = null)
{
$member['data'][0]['status']='';
$member = Mage::getSingleton('monkey/api')
->listMemberInfo($listId, $email);
$on = FALSE;
if($member['success'] && ($member['data'][0]['status'] == 'subscribed')){
$on = TRUE;
}

return $on;
}

We are going to add this as an issue and will make a fix for this.
Thanks for your post.
Let me know if this help to solve the error, otherwise we try another thing.
Kindest Regards
Gravatar
Joined: 2012-03-09
Posts: 1171
Hi Joshua,

Any news? Could you fix this error?
Also i would like to know which version of Magento are you using?

Thanks in advice

Kindest Regards
Gravatar
Joined: 2012-05-09
Posts: 3
Thank you for your assistance. I am running version 1.6.2

Having updated the Data.php and reuploading the file I now get this error:

Fatal error: Cannot use string offset as an array in /home/coolerpr/public_html/app/code/community/Ebizmarts/MageMonkey/Helper/Data.php on line 214

Here are the pertinent lines from Data.php for your review:

207 */
208 public function subscribedToList($email, $listId = null)
209 {
210 $member['data'][0]['status']='';
211 $member = Mage::getSingleton('monkey/api')
212 ->listMemberInfo($listId, $email);
213 $on = FALSE;
214 if($member['success'] && ($member['data'][0]['status'] == 'subscribed')){
215 $on = TRUE;
216 }
217
218 return $on;
219 }
220
221
Gravatar
Joined: 2012-03-09
Posts: 1171
Hi Joshua,

I will tell you how to fix this in a moment.
Thank you for let me know.

Kindest Regards
Gravatar
Joined: 2012-03-09
Posts: 1171
Hi Joshua,

Do the following:

* Go to the configuration of the MageMonkey
* Change the default list ("General Subscription"wink and save the configuration.
* Change the list again to the one you want to use as default and save the configuration again.

That solved the problem in my case, hope it solve yours too.
Thanks for letting know this issue.

Kindest Regards
Gravatar
Joined: 2012-05-09
Posts: 3
That was the solution. Thank you for your timely assistance.
Gravatar
Joined: 2012-03-09
Posts: 1171
Hi Joshua,

We will make an extra validation there, it could happen when you save the configuration for first time.
Thanks to you for letting us know this smile

Kindest Regards