Steps to reproduce:

  1. Enable Custom Formatters and Insert
  2. Enable the default "Image" formatter.
  3. Add an image field to a content type, and configure with Insert and the "Image formatter"
  4. Create a node and upload an image. You don't need to "insert" it.
  5. Submit the form.
  6. Edit the node.

After step 5, you'll see the following (non-fatal) errors:

Notice: Undefined index: entity keys in entity_extract_ids() (line 7372 of /includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7373 of /includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7376 of /includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /modules/field/field.multilingual.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7372 of /includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7373 of /includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7376 of /includes/common.inc).

More importantly, after step 6, you'll see a WSOD with the following fatal error:

Recoverable fatal error: Object of class stdClass could not be converted to string in form_get_cache() (line 474 of /includes/form.inc).

It comes from custom_formatters_insert_content(), which passes form_get_cache() with a node object, but form_get_cache() is expecting a string.

Comments

joelstein’s picture

There's a similar issue for D6... not sure if it's related, though.

#1177584: no longer works with Insert

deciphered’s picture

Status: Active » Postponed (maintainer needs more info)

Unable to reproduce, can you please clarify the steps?

2. Enable the default "Image" formatter.

What is the default "image" formatter? Custom Formatters comes with two default image formatters, 'Example: Image (PHP)' and 'Example: Image (HTML + Token)'. Was it one of them? I tested with both and it worked as expected.

Cheers,
Deciphered.

joelstein’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Postponed (maintainer needs more info) » Active

Hmm, when I download the latest 7.x-2.x-dev, I only see "Example: Image (PHP)" as the default formatter. Are you testing this against D6 or D7?

FYI: I just tried it again with the latest dev, and produced the same results as originally reported.

deciphered’s picture

The issue says 7, therefore I'm testing 7.

The Token based example will only be present if the Token module is present.

Well the testing I did was unable to reproduce the issue, so I will need either more detailed information or access to a site that can reproduce the issue before I can proceed.

Cheers,
Deciphered.

joelstein’s picture

I don't have Token enabled on this site. In fact, it's just a vanilla installation of Drupal 7.8 (standard installation profile), Custom Formatters 7.x-2.x-dev, Insert 7.x-1.1, and Ctools 7.x-1.0-rc1.

I enabled Token 7.x-1.0-beta5, and now I see the "Example: Image (HTML + Token)" formatter. However, the error still occurs with the first formatter.

I'll setup a sandbox and send you the link so you can see it in action.

deciphered’s picture

Status: Active » Fixed

Fixed and committed to 7.x-2.x.

Cheers,
Deciphered.

Status: Fixed » Closed (fixed)

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

dlnsk’s picture

Version: 7.x-2.x-dev » 7.x-2.0
Status: Closed (fixed) » Active

Drupal 7.12, Custom Formatters 7.x-2.0 (downloaded today), Insert 7.x-1.1, Token 7.x-1.0-rc1, and Ctools 7.x-1.0-rc2.

When I enable any default formatter or add own for image field and allow to use it in imagefield options of content type (see steps 1-6 from first post). When I try open edit form of node I see next fatal error:

Recoverable fatal error: Object of class stdClass could not be converted to string in function form_get_cache() (line 489 in file /var/www/includes/form.inc).

I was try to use 2.x-dev version of Custom Formatter. This version don't rise current error but when I try to insert image by clicking on "Insert" button nothing is happens.

dlnsk’s picture

After step 5 I see this:

    Notice: Undefined index: entity keys в функции entity_extract_ids() (строка 7495 в файле /var/www/includes/common.inc).
    Notice: Undefined index: entity keys в функции entity_extract_ids() (строка 7496 в файле /var/www/includes/common.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name в функции field_language() (строка 278 в файле /var/www/modules/field/field.multilingual.inc).
alexkb’s picture

Seeing the same issue here. I'm not using the default formatters, just my own, but after checking these thoroughly and making sure they all had conditional checks to only get used if the data existed (i.e. to avoid php notices that might trigger the fatal error if an eval()), I still had the issue. Proceeded to disable the insert module, as it didn't actually end up getting used, and the issue went away. One thing to point out, the error only occurred when editing content of content types that had fields, that didn't use the custom formatters.

Sorry, I was using 2.0, not 7.x-2.x where Deciphered has already made the fix.

Taxoman’s picture

Status: Active » Fixed

So use the -dev version until 2.1 gets released.
(Which it should be "asap", as the "Recommended" status is misleading now)

Status: Fixed » Closed (fixed)

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