I have similar problem as reported in here #1049120: Imagefield images get cleared if existing node is saved without opening wysiwyg selector. but for me the images are not deleted (maybe because i use private file system) Anyway when on add node images cck field is hidden to be use in popup window that for edit node is not and popup window is just empty.

Comments

ShadowMonster’s picture

When I set stable lang code 'pl' instead LANGUAGE_NONE then it is working well. There can be problem because when add node it is set on 'und' and when editing 'pl' (Polish in my case).

Carlos Miranda Levy’s picture

I have the same issue.

When you add a node, the icon in the WYSIWYG bar works fine invoking the add image widget, which is otherwise hidden from the whole form.

But if I try to edit a node, then widget is displayed with the rest of the form and the icon in the WYSIWYG bar returns an empty window.

I hope this explains it better.

ShadowMonster’s picture

Check if this will help you it is just fast dirty fix - replace this function on this below:

function wysiwyg_imagefield_after_build($form_element, &$form_state) {
  $imagefield = variable_get("wysiwyg_imagefield_{$form_element['#bundle']}", NULL);
  if (!is_null($imagefield) && ($index = _wysiwyg_imagefield_array_search_recursive($form_element, $imagefield)) !== FALSE) {
    $element = &$form_element;

    // Select non-root level $element.
    if (!empty($index)) {
      $index = explode('][', $index);
      while ($index) {
        $element = &$element[array_shift($index)];
      }
    }

        $lang = 'und';
        if($element['nid']['#value'] != NULL) {
                $lang = 'pl'; //change on your lang code
                }

    // Modify file handler element.
    $element[$imagefield][$lang]['#prefix'] = "<div id='wysiwyg_imagefield-wrapper'>{$element[$imagefield][$lang]['#prefix']}";
    $element[$imagefield][$lang]['#suffix'] = "{$element[$imagefield][$lang]['#suffix']}</div>";

    // Add Javascript.
    drupal_add_library('system', 'ui.dialog');
    drupal_add_js(
      array(
        'WysiwygImageField' => array(
          'field' => $imagefield,
          'title' => $element[$imagefield][$lang]['#title']
        )
      ),
      array(
        'type' => 'setting',
        'scope' => JS_DEFAULT,
      )
    );
  }

  return $form_element;
}

You need change the lang code on your - probably on en

kpblcc’s picture