Title: Illegal string offset error &quot;GroupName&quot; when adding a new feed
Last modified: August 30, 2016

---

# Illegal string offset error "GroupName" when adding a new feed

 *  [Andrei G.](https://wordpress.org/support/users/27shutterclicks/)
 * (@27shutterclicks)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/illegal-string-offset-error-groupname-when-adding-a-new-feed/)
 * Hi,
 * I installed the plugin and entered the YMLP credentials on the settings screen.
 * Then, I tried to add a new feed and got a strange warning within the Select a
   YMLP feed dropdown menu. The dropdown menu had two entries that looked something
   like:
 * Warning: Illegal string offset “GroupName” in … /ymlp/ymlp.php
 * Obviously, the actual YMLP group names were not displayed and when selecting 
   one of the warning choices and then attempting to select a Gravity Form form 
   from the next dropdown menu, nothing would happen. There would be just a circle
   spinning continously.
 * I verified the username and API key and they were correct (according to the client
   on behalf on which I was setting this up and who had provided them).
 * Now, I poked around the plugin code and found that somewhere around line 1259
   of ymlp.php there is a call to get the list of groups via the api:
 * `$lists = $api->GroupsGetList();`
 * Then, there’s a check to see if there are no lists and if so to display the error:
 *     ```
       if (!$lists){
   
                           echo __("Could not load YMLP contact lists. <br/>Error: ", "gravity-forms-ymlp");
   
                           echo isset($api->ErrorMessage) ? $api->ErrorMessage : '';
   
                       }
       ```
   
 * The, all the logic happens in the else of the above if (if there are indeed lists).
 * To troubleshoot it, I added a variable dump to understand the nature of $lists
   in my scenario and see what it contained, if anything (this was added on line
   1260, right after the call to list the groups:
 *     ```
       echo "<pre>";
       			print_r($lists);
       			echo "</pre>";
       ```
   
 * This resulted in the following being displayed in the add new feed screen:
 *     ```
       Array
       (
           [Code] => 101
           [Output] => API access is disabled.  To enable it, select API under the Configuration tab in your account.
       )
       ```
   
 * So that means that if the plugin is unable to get the lists via the api (like
   in this example when API access is disabled in the YMLP account), the $lists 
   variable/array will not be empty.
 * Thus, the check “if (!$lists){” will in fact be ignored (because the array is
   not empty) and the “else” be executed, except that there are no actual lists 
   to display and the result will be the unfriendly illegal string offset warning.
 * Now, I was able to access the actual YMLP account in question and verify that
   indeed API access was not enabled (although the API key was displayed in the 
   API section). Enabling the API access in the YMLP account fixed the issues I 
   was having, but I would have had no idea this was the cause of everything had
   I not gone through this entire process.
 * As a regular user, I would have simply assumed that this is a bad/broken/incompatible
   plugin and uninstalled it immediately.
 * It would be great if you could correct the plugin to also check if $lists may
   not empty but instead contain an error message. Something like:
 *     ```
       } elseif ($lists[Code]) { //check for failure code
   
       	echo "Error: " . $lists[Output]; //display the failure message
   
       }
       ```
   
 * According to the YMLP documentation, the following is returned in case of failure
   for the Groups.GetList() api call:
 *     ```
       Failure:
   
       Returncode 100 : "Invalid or missing API key"
       Returncode 101 : "API access is disabled"
       Returncode 102 : "API access not allowed from this IP address ([IP])"
       ```
   
 * Hope this helps and thank you for this useful plugin.
 * [https://wordpress.org/plugins/ymlp/](https://wordpress.org/plugins/ymlp/)

The topic ‘Illegal string offset error "GroupName" when adding a new feed’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ymlp_dae4e8.svg)
 * [Gravity Forms YMLP Add-on](https://wordpress.org/plugins/ymlp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ymlp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ymlp/)
 * [Active Topics](https://wordpress.org/support/plugin/ymlp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ymlp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ymlp/reviews/)

## Tags

 * [illegal string offset](https://wordpress.org/support/topic-tag/illegal-string-offset/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 0 replies
 * 1 participant
 * Last reply from: [Andrei G.](https://wordpress.org/support/users/27shutterclicks/)
 * Last activity: [10 years, 12 months ago](https://wordpress.org/support/topic/illegal-string-offset-error-groupname-when-adding-a-new-feed/)
 * Status: not resolved