Closed (fixed)
Project:
Insert
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2011 at 07:41 UTC
Updated:
20 Sep 2012 at 09:01 UTC
Jump to comment: Most recent file
Having this error on some places inside my drupal installation:
Notice: Undefined index: instance in insert_form_field_ui_field_edit_form_alter() (line 246 of /drupal/sites/all/modules/insert/insert.module).
I fixed it by adding an isset for the $form['instance']
I hope to see this fix added into the module :)
/**
* Implements hook_form_alter().
*/
function insert_form_field_ui_field_edit_form_alter(&$form, $form_state) {
if (isset($form['instance']) && array_key_exists($form['instance']['widget']['type']['#value'], insert_widgets())) {
$field = $form['#field'];
$instance = field_info_instance($form['instance']['entity_type']['#value'], $form['instance']['field_name']['#value'], $form['instance']['bundle']['#value']);
$form['instance']['settings'] += insert_field_widget_settings_form($field, $instance);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | insert_php53_merge.patch | 885 bytes | quicksketch |
| #6 | insert_php53_merge.patch | 699 bytes | quicksketch |
Comments
Comment #1
Babalu commentedsubscribing
Comment #2
kelutrab11 commentedsub
Comment #3
BenK commentedSubscribing
Comment #4
dimitriseng commentedHi, I also had this issue in D7 and the suggestion above has removed the error. Can this be reviewed please?
Comment #5
hongpong commentedI had similar PHP notices pop up. Probably a PHP5.3 thing?
Notice: Undefined index: insert in insert_field_widget_settings_form() (line 294 of /insert/insert.module).
Notice: Undefined index: insert_styles in insert_field_widget_settings_form() (line 302 of /insert/insert.module).
Notice: Undefined index: insert_default in insert_field_widget_settings_form() (line 312 of /insert/insert.module).
Notice: Undefined index: insert_class in insert_field_widget_settings_form() (line 319 of /insert/insert.module).
Notice: Undefined index: insert_width in insert_field_widget_settings_form() (line 328 of /insert/insert.module).
Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 2251 of /includes/form.inc).
Comment #6
quicksketchYeah we needed a similar fix in FileField Sources recently. This should fix the main issue.
Comment #7
quicksketchHm, actually take that back. Looking at the original issue, it's about $form['instance'] missing, not $form['instance']['settings']. I *think* this patch covers the whole problem as it matches the approach used by FileField Sources
If not, could you describe the situation in which this error occurs? This patch is now in the latest Git repo.