After installing the insert module on drupal 7.0-alpha4 I receive the following errors after attempting to create a new file field:

    *  Notice: Undefined index: object_type in insert_form_field_ui_field_edit_form_alter()  (line 254 of /shared/site/www/sites/all/modules/insert/insert.module).
    * Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 1774 of /shared/site/www/includes/form.inc).

Also when trying to add files to already existing file fields, the form fields are missing.

CommentFileSizeAuthor
#8 insert-file-api-change-792024-8.patch1.48 KBmlncn

Comments

gleroux02’s picture

After looking at the $form array a little bit further it looks like this issue is that $form['instance']['object_type']['#value'] should be $form['instance']['entity_type']['#value'] on line 255. The second part of the issue where the field is not appearing on the node's edit screen appears that it could be a separate and unrelated issue.

quicksketch’s picture

Thanks, this sounds like an API clean-up that likely occurred in between Drupal 7 versions.

tsvenson’s picture

Just tried the alpha1 on D7a5 and got the same error with one small exception. Second error referes to line 1772 instead of 1774.

It is possible to enable and configure insert for the CT, but on the node edit page the fieldgroup only contains the label. The images are gone.

Any fix available for this yet?

tsvenson’s picture

When I then edited the image field, to disable Insert, I got the following:

    *  Notice: Undefined index: #file in theme_file_widget_multiple()  (line 761 of D:\wamp\www\d7\modules\file\file.field.inc).
    * Notice: Undefined index: #file in theme_file_widget_multiple() (line 761 of D:\wamp\www\d7\modules\file\file.field.inc).
    * Notice: Undefined index: #file in theme_file_widget_multiple() (line 761 of D:\wamp\www\d7\modules\file\file.field.inc).
    * Notice: Undefined index: object_type in insert_form_field_ui_field_edit_form_alter() (line 254 of D:\wamp\www\d7\sites\all\modules\insert\insert.module).
    * Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 1772 of D:\wamp\www\d7\includes\form.inc).
    * Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 104 of D:\wamp\www\d7\includes\entity.inc).
tsvenson’s picture

Sorry, missed the part about changing to entity_type above. However, it doesn't fix the problem.

When editing the image field, both with and without Insert enabled i get:

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 104 of D:\wamp\www\d7\includes\entity.inc).

When disabling Insert I get the following in the Manage Field list:

    *  Notice: Undefined index: #file in theme_file_widget_multiple()  (line 761 of D:\wamp\www\d7\modules\file\file.field.inc).
    * Notice: Undefined index: #file in theme_file_widget_multiple() (line 761 of D:\wamp\www\d7\modules\file\file.field.inc).
    * Notice: Undefined index: #file in theme_file_widget_multiple() (line 761 of D:\wamp\www\d7\modules\file\file.field.inc).

Only way to get the images back is to disable the Insert module.

BenK’s picture

Subscribing...

will_in_wi’s picture

subscribe

mlncn’s picture

Status: Active » Needs review
StatusFileSize
new1.48 KB

Converting all (3) object_type references to entity_type per gleroux02 in #1 worked for me.

quicksketch’s picture

Status: Needs review » Fixed

Thanks Benjamin! Committed.

Status: Fixed » Closed (fixed)

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