Title: Invalid Argument in code
Last modified: February 24, 2017

---

# Invalid Argument in code

 *  Resolved [69thelememt](https://wordpress.org/support/users/69thelememt/)
 * (@69thelememt)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-in-code/)
 * I get the following error when trying to allocate a segment
 * Invalid argument supplied for foreach() in /home/infographicalley/public_html/
   wp-content/plugins/automate-mautic/classes/class-apm-rulepanel.php on line 159
 * Please help
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [69thelememt](https://wordpress.org/support/users/69thelememt/)
 * (@69thelememt)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-in-code/#post-8843619)
 * $all_segments = ‘<select class=”root-seg-action” name=”ss_seg_action[]”>’;
    $
   all_segments .= ‘<option>’ . __( ‘Select Segment’, ‘automateplus-mautic-wp’ ).‘
   </option>’;
 *  foreach ( $segments->lists as $offset => $list ) {
    $all_segments .= self::make_option(
   $list->id, $list->name, $select ); } $all_segments .= ‘</select>’; echo $all_segments;}
 *  [Rahul Walunje](https://wordpress.org/support/users/rahulwalunje-1/)
 * (@rahulwalunje-1)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-in-code/#post-8851397)
 * [@69thelememt](https://wordpress.org/support/users/69thelememt/) There is something
   wrong while getting segments from Mautic API. I would suggest you to please click
   on ‘Refresh Mautic Data’ which you can find at bottom right corner of automate
   admin page. Also make sure to use latest version of AutomatePlus – Mautic for
   WordPress.
 * Hope it will solve your problem.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Invalid Argument in code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/automate-mautic_717089.svg)
 * [AutomatePlug - Mautic for WordPress](https://wordpress.org/plugins/automate-mautic/)
 * [Support Threads](https://wordpress.org/support/plugin/automate-mautic/)
 * [Active Topics](https://wordpress.org/support/plugin/automate-mautic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/automate-mautic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/automate-mautic/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rahul Walunje](https://wordpress.org/support/users/rahulwalunje-1/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/invalid-argument-in-code/#post-8851397)
 * Status: resolved