See screenshot

CommentFileSizeAuthor
#16 Selection_022.png105.46 KBygerasimov
ajax_error.png51.61 KBaspilicious

Comments

duellj’s picture

Having the same problem. Here's some more info on the error:

Fatal error message:

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /Users/jonduell_pro/Sites/drupal7.dev/includes/common.inc on line 5878

And here's the args being passed to the function that's causing it to fail:


            [file] => /Users/jonduell_pro/Sites/drupal7.dev/includes/form.inc
            [line] => 1035
            [function] => drupal_array_set_nested_value
            [args] => Array
                (
                    [0] => Array
                        (
                            [field] => Array
                                (
                                    [settings] => Array
                                        (
                                            [uri_scheme] => public
                                            [default_image] => 11
                                        )

                                )

                            [field_settings_default_image_upload_button] => Upload
                        )

                    [1] => Array
                        (
                            [0] => field
                            [1] => settings
                            [2] => default_image
                            [3] => upload_button
                        )

                    [2] => Upload
                )
aspilicious’s picture

Ow btw, there is nothing wrong with the upload just a warning message

rfay’s picture

duellj’s picture

Priority: Normal » Major

Now that the issue from #3 (and the issue that was a duplicate of) are closed, I'm increasing the priority of this issue. Definitely not a duplicate, problem still persists.

duellj’s picture

Title: Ajax warning when setting default image on image field » Ajax warning when uploading to managed_file field

Changing title, this actually happens with all managed_file field types.

seanberto’s picture

duellj’s picture

Doesn't seem to be related to #745590: #managed_file element does not work when #extended not TRUE, or when ancestor element doesn't have #tree=TRUE, problem happens even when a #managed_file is at the top level of a form.

effulgentsia’s picture

Component: ajax system » file.module

Subscribing.

Anonymous’s picture

subscribe, coming from a duplicate report at #951158: Cannot upload default Image (field api).

groschan’s picture

After setting element property #tree to false looks good at first sight.

file.module:360 (function file_managed_file_process):
$element['#tree'] = false;

Except in this case element value won't be saved in form_state['values'].

Anonymous’s picture

yched’s picture

Status: Active » Closed (duplicate)

The report in the OP happens precisely in a case (Field instance settings form) where the #managed_file element is *not* at the top level of the $form.

@duellj - or others : can you report other examples of forms where the error happens ?
Until then, marking as a dupe of #745590: #managed_file element does not work when #extended not TRUE, or when ancestor element doesn't have #tree=TRUE

duellj’s picture

@yched:

I get the same error described in #1 for all of the following cases:


  $form['default_image'] = array(
    '#title' => t('image'),
    '#type' => 'managed_file',
  );

  $form['notree'] = array(
    '#tree' => FALSE,
  );
  $form['notree']['no_tree_default_image'] = array(
    '#title' => t('image'),
    '#type' => 'managed_file',
  );

  $form['tree'] = array(
    '#tree' => TRUE,
  );
  $form['tree']['tree_default_image'] = array(
    '#title' => t('image'),
    '#type' => 'managed_file',
  );
aidanlis’s picture

Status: Closed (duplicate) » Active

#745590: #managed_file element does not work when #extended not TRUE, or when ancestor element doesn't have #tree=TRUE is a different error message and upon further inspection does not seem to be related.

This bug also prevents uploading default images when using the Image widget in Fields.

This is effecting HEAD as of writing this post.

yched’s picture

[edited out, I was on crack]

ygerasimov’s picture

StatusFileSize
new105.46 KB

Subscribe.

You can find callstack in attached screenshot.

duellj’s picture

Status: Active » Closed (duplicate)

It looks like they took up this bug in #745590: #managed_file element does not work when #extended not TRUE, or when ancestor element doesn't have #tree=TRUE and the patch in #24 in that issue seems to fix this bug. Marking as duplicate