Are you getting this too ?

Add a "feed" view display
Choose MediaRSS in the line style
Click Update, you get this warning :

* warning: Invalid argument supplied for foreach() in /var/www/drupal6/includes/form.inc on line 1193.
* warning: Invalid argument supplied for foreach() in /var/www/drupal6/includes/form.inc on line 1193.

Comments

Microbe’s picture

Version: 6.x-2.3 » 6.x-2.x-dev
Status: Active » Fixed

Yeah i am getting this, was testing all from old displays so haven't been adding new ones.
Defaults needed to be set before the style plugin settings loads, which they should do now in 2.x-dev (it won't update till midnight though i don't think but you can download from cvs)

Peter

computer_jin’s picture

have u solved your problem?????

guillaumeduveau’s picture

Yes Microbe fixed it, 6.x-2.4 is OK for me.

computer_jin’s picture

but i m still having this problem can you please tell me how can i solve this problem

Microbe’s picture

do you get the exact same error?
if so it could be caused by another module

guillaumeduveau’s picture

...like Panels page computer_jiin ?
http://drupal.org/node/316253

computer_jin’s picture

I m getting this error i think this is the same error.

warning: Invalid argument supplied for foreach() in \includes\form.inc on line 1193.

Status: Fixed » Closed (fixed)

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

computer_jin’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

I m also having this error but my module is working fine but tell me how can i remove this error is there any posible way to remove this i have spent lots of time on it but did nt find any solution....any one know about how to remove this error..

the error is ......
* warning: Invalid argument supplied for foreach() \includes\form.inc on line 1193.
* warning: Invalid argument supplied for foreach() in \includes\form.inc on line 1416.

Microbe’s picture

I removed (as far as I know) this error from the media rss module by using function option_definition() in the views class. All the arrays used in the views style / row class options have to be initialized otherwise they give this error.

The media rss code for this is:

function option_definition() {
    $options = parent::option_definition();
    $options['teaser']['item_length'] = array('default' => 'default');
    $options['mediarss_typename'] = array('default' => array());
    $options['mediarss_imgfield'] = array('default' => array());
    $options['teaser']['mediarss_cachepreset'] = array('default' => array());
    $options['teaser']['item_picture_size'] = array('default' => 'preview');
    $options['content']['mediarss_cachepreset'] = array('default' => array());
    $options['content']['item_picture_size'] = array('default' => '_original');
    $options['thumbnail']['mediarss_cachepreset'] = array('default' => array());
    $options['thumbnail']['item_picture_size'] = array('default' => 'thumbnail');
    return $options;
  }
computer_jin’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Hi every one ,
I am also having this same issue before many days and today i debug how can i solve this issue actually i was having error ....
warning: Invalid argument supplied for foreach() in \includes\form.inc on line 1193.
I am having this issue and when i debug and comment the code of checkboxes in my module than this error is resolved but i have to use this checkboxes ,check my code if i m missing some minor code and tell me how can i solve this ..

$form['payment_options']['business_payment_method']= array(
'#type' => 'checkboxes',
'#title'=> t('Payment Options'),
'#default_value' => variable_get('business_payment_method',$selected_payment),
'#options' => $payment_options,
);
I am using this tell me if you understand how can i solve this issue ...

Thanks in Advance

Azhar
4 Ace Technologies(www.4acetech.com)
karachi,Pakistan

Microbe’s picture

add this function to the class (check that's its not already there first)

function option_definition() {
    $options = parent::option_definition();
    
    // following line is the one you need to add if the function already exists.
    $options['payment_options']['business_payment_method'] = array('default' => array());
   
    return $options;
  }

use that line for each form data you use that has checkboxes

computer_jin’s picture

Thanks Microbe i have solved this problem.

Microbe’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

glad i could help

computer_jin’s picture

but Now I am having a new problem, I have understand why i am having this issue but not understanding how can i solve this ,
please check and tell me how can i solve this....

$form['basic_information']['city'] = array(
'#type' => 'select',
'#title' => t('City'),
'#description' => t('Select City.'),
'#required' => TRUE,
//'#options' => array(),
);
I know if i will uncomment #options it will work and error will be remove but actually when i uncomment and than submit i got "An illegal choice has been detected. Please contact the site administrator." And when i comment options illegal choice did nt come,how can i use this options here and i m sending these options from my ajax because i select any country it will show its related cities..
i will send you peice of code of ajax.


function business_listing_callback() {
  $id=$_GET['id'];

  $sql="select * from {business_listing_subcategories} where subcategory_id=".$id;
  $result=db_query($sql);
  while($data =db_fetch_object($result)) {
  $output_combo_box.= "<option value='".$data->id."'>".$data->subcategory_name."</option>";
}

  drupal_page_header();

	if($id == ""){
		 $output_combo_box.= "<option value='0'>Please Select Subcategory</option>";
	}
  print drupal_to_js($output_combo_box);
  exit();
}
computer_jin’s picture

but Now I am having a new problem, I have understand why i am having this issue but not understanding how can i solve this ,
please check and tell me how can i solve this....

$form['basic_information']['city'] = array(
'#type' => 'select',
'#title' => t('City'),
'#description' => t('Select City.'),
'#required' => TRUE,
//'#options' => array(),
);
I know if i will uncomment #options it will work and error will be remove but actually when i uncomment and than submit i got "An illegal choice has been detected. Please contact the site administrator." And when i comment options illegal choice did nt come,how can i use this options here and i m sending these options from my ajax because i select any country it will show its related cities..
i will send you peice of code of ajax.


function business_listing_callback() {
  $id=$_GET['id'];

  $sql="select * from {business_listing_subcategories} where subcategory_id=".$id;
  $result=db_query($sql);
  while($data =db_fetch_object($result)) {
  $output_combo_box.= "<option value='".$data->id."'>".$data->subcategory_name."</option>";
}

  drupal_page_header();

	if($id == ""){
		 $output_combo_box.= "<option value='0'>Please Select Subcategory</option>";
	}
  print drupal_to_js($output_combo_box);
  exit();
}

Thanks .

computer_jin’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)